Ready to Start Your Career?

12 Practice Drills for the Linux Command Line

Homer 's profile image

By: Homer

October 1, 2015

12 Review Drills for Linux Command Line - CybraryAfter 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:~$". 

1- parted

"parted" is a command-line partition manipulation program.david@latitude-e6230:~$ sudo parted(parted) help(parted) print all(parted) quit 

2 - gparted

"gparted" is the graphical version of parted, but it's not always installed by default.david@latitude-e6230:~$ gparteddavid@latitude-e6230:~$ sudo apt-get install gparteddavid@latitude-e6230:~$ sudo gparted 

3 - last

"last" lists user login events.david@latitude-e6230:~$ lastdavid@latitude-e6230:~$ last rebootdavid@latitude-e6230:~$ last david 

4 - df

"df" reports filesystem disk space info.david@latitude-e6230:~$ dfdavid@latitude-e6230:~$ df --helpdavid@latitude-e6230:~$ df -h 

5 - free

"free" reports RAM usage info. "^C" stands for "ctrl+C".david@latitude-e6230:~$ freedavid@latitude-e6230:~$ free --helpdavid@latitude-e6230:~$ free -hdavid@latitude-e6230:~$ free -s 1^Cdavid@latitude-e6230:~$ free -hs 1^C 

6 - ps

"ps" returns a snapshot of the current system processes.david@latitude-e6230:~$ psdavid@latitude-e6230:~$ ps --help alldavid@latitude-e6230:~$ ps -x 

7 - kill

"kill" terminates processes. "21196" happened to be the process id ("pid") of the terminal window.david@latitude-e6230:~$ killdavid@latitude-e6230:~$ ps -xdavid@latitude-e6230:~$ kill 21196 

8 - find

"find" searches for files.david@latitude-e6230:~$ finddavid@latitude-e6230:~$ find Desktopdavid@latitude-e6230:~$ find D*david@latitude-e6230:~$ find *sdavid@latitude-e6230:~$ find V???ualB* 

9 - ifconfig

"ifconfig" configures network interfaces.david@latitude-e6230:~$ ifconfigdavid@latitude-e6230:~$ ifconfig wlan0david@latitude-e6230:~$ sudo ifconfig wlan0 downdavid@latitude-e6230:~$ ifconfigdavid@latitude-e6230:~$ ifconfig -adavid@latitude-e6230:~$ sudo ifconfig wlan0 up 

10 - cp

"cp" copies files and folders.david@latitude-e6230:~$ cp /var/log/dmesg ./Desktopdavid@latitude-e6230:~$ ls ./Desktopdavid@latitude-e6230:~$ cp ./Desktop/dmesg ./Desktop/dmesg1david@latitude-e6230:~$ ls ./Desktopdavid@latitude-e6230:~$ cp ./Desktop/dmesg ./Desktop/dmesg1 .david@latitude-e6230:~$ ls 

11 - mv

"mv" moves and renames files.david@latitude-e6230:~$ mv ./dmes* ./Desktopdavid@latitude-e6230:~$ lsdavid@latitude-e6230:~$ ls ./Desktopdavid@latitude-e6230:~$ mv ./Desktop/dmes* .david@latitude-e6230:~$ lsdavid@latitude-e6230:~$ mv dmesg1 dmesg2david@latitude-e6230:~$ lsdavid@latitude-e6230:~$ mv dmesg dmesg2david@latitude-e6230:~$ lsdavid@latitude-e6230:~$ mv dmesg2 ./Desktop/dmesg.msgdavid@latitude-e6230:~$ ls ./Desktop 

12 - du

"du" returns the size of files and folders.david@latitude-e6230:~$ dudavid@latitude-e6230:~$ du -hdavid@latitude-e6230:~$ du -h /var/log/*david@latitude-e6230:~$ du -h /var/logdavid@latitude-e6230:~$ du -h /proc/*david@latitude-e6230:~$ du -h /procdavid@latitude-e6230:~$ du -c /david@latitude-e6230:~$ du -ch /david@latitude-e6230:~$ du -ch /home/daviddavid@latitude-e6230:~$ du -chd1 /home/daviddavid@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!SaveSave
Schedule Demo
Build your Cybersecurity or IT Career
Accelerate in your role, earn new certifications, and develop cutting-edge skills using the fastest growing catalog in the industry