Related Reads
After watching the “The Linux Command Line Interface” Cybrary module, it’s important to practice the commands introduced in the module. What follows is a simple listing of commands you can run through on your own system(s) to build familiarity for the test and confidence on the command line. Down the road, it can be helpful to return to these commands from time to time.
Be sure to study the each command’s output to gain greater insight into their functionality. Don’t be afraid to play around with them (so long as everything is kept inside a VM, no serious harm will result!)
These commands were run on Lubuntu Linux by the user “david” on the machine “latitude-e6230” The default command prompt is “david@latitude-e6230:~$”.
“parted” is a command-line partition manipulation program.
david@latitude-e6230:~$ sudo parted
(parted) help
(parted) print all
(parted) quit
“gparted” is the graphical version of parted, but it’s not always installed by default.
david@latitude-e6230:~$ gparted
david@latitude-e6230:~$ sudo apt-get install gparted
david@latitude-e6230:~$ sudo gparted
“last” lists user login events.
david@latitude-e6230:~$ last
david@latitude-e6230:~$ last reboot
david@latitude-e6230:~$ last david
“df” reports filesystem disk space info.
david@latitude-e6230:~$ df
david@latitude-e6230:~$ df –help
david@latitude-e6230:~$ df -h
“free” reports RAM usage info. “^C” stands for “ctrl+C”.
david@latitude-e6230:~$ free
david@latitude-e6230:~$ free –help
david@latitude-e6230:~$ free -h
david@latitude-e6230:~$ free -s 1
^C
david@latitude-e6230:~$ free -hs 1
^C
“ps” returns a snapshot of the current system processes.
david@latitude-e6230:~$ ps
david@latitude-e6230:~$ ps –help all
david@latitude-e6230:~$ ps -x
“kill” terminates processes. “21196” happened to be the process id (“pid”) of the terminal window.
david@latitude-e6230:~$ kill
david@latitude-e6230:~$ ps -x
david@latitude-e6230:~$ kill 21196
“find” searches for files.
david@latitude-e6230:~$ find
david@latitude-e6230:~$ find Desktop
david@latitude-e6230:~$ find D*
david@latitude-e6230:~$ find *s
david@latitude-e6230:~$ find V???ualB*
“ifconfig” configures network interfaces.
david@latitude-e6230:~$ ifconfig
david@latitude-e6230:~$ ifconfig wlan0
david@latitude-e6230:~$ sudo ifconfig wlan0 down
david@latitude-e6230:~$ ifconfig
david@latitude-e6230:~$ ifconfig -a
david@latitude-e6230:~$ sudo ifconfig wlan0 up
“cp” copies files and folders.
david@latitude-e6230:~$ cp /var/log/dmesg ./Desktop
david@latitude-e6230:~$ ls ./Desktop
david@latitude-e6230:~$ cp ./Desktop/dmesg ./Desktop/dmesg1
david@latitude-e6230:~$ ls ./Desktop
david@latitude-e6230:~$ cp ./Desktop/dmesg ./Desktop/dmesg1 .
david@latitude-e6230:~$ ls
“mv” moves and renames files.
david@latitude-e6230:~$ mv ./dmes* ./Desktop
david@latitude-e6230:~$ ls
david@latitude-e6230:~$ ls ./Desktop
david@latitude-e6230:~$ mv ./Desktop/dmes* .
david@latitude-e6230:~$ ls
david@latitude-e6230:~$ mv dmesg1 dmesg2
david@latitude-e6230:~$ ls
david@latitude-e6230:~$ mv dmesg dmesg2
david@latitude-e6230:~$ ls
david@latitude-e6230:~$ mv dmesg2 ./Desktop/dmesg.msg
david@latitude-e6230:~$ ls ./Desktop
“du” returns the size of files and folders.
david@latitude-e6230:~$ du
david@latitude-e6230:~$ du -h
david@latitude-e6230:~$ du -h /var/log/*
david@latitude-e6230:~$ du -h /var/log
david@latitude-e6230:~$ du -h /proc/*
david@latitude-e6230:~$ du -h /proc
david@latitude-e6230:~$ du -c /
david@latitude-e6230:~$ du -ch /
david@latitude-e6230:~$ du -ch /home/david
david@latitude-e6230:~$ du -chd1 /home/david
david@latitude-e6230:~$ du -hd1 -t1M /home/david
By simply running through this commands once a day at intervals leading up to your test, their usage and meaning should make their way into your long term memory. From there, they can be recalled at will for the exam.
Have fun!
Did You Know?
Cybrary has tons of FREE training resources!
For lifetime access simply CREATE A FREE ACCOUNT.
Already a member? login here.
We recommend always using caution when following any link
Are you sure you want to continue?
nice listing of basic command bu t free -s 1 doesnt work free: seconds argument `1′ failed other parameters give the same result
Linux kali-02HP6550 4.0.0-kali1-amd64 #1 SMP Debian 4.0.4-1+kali2 (2015-06-03) x86_64 GNU/Linux
nice
Is what I need, practice, practice, practice.