10 Commands Every Linux Newbie Should Know – Part 1
Almost every Linux geek today have gone through the same thing and knows how it feels to be in the shoes of a newbie.
Since they (advanced users) were also helped by others to get used to things as newbies, the cycle continues. Yes, this is why the community will continue to grow at a rate we can’t even describe.
Today am going to show any Linux newbie who is finding things very difficult with the terminal.
NOTE: The angle brackets (< and >) in this tutorial are not part of the commands. (Please do not type them)
The command above when separated into individual words reads “Who am I”. This is just asking someone who knows your name already, what is my name? It displays the name of the current user in the terminal.
enock@enock-pc:~$ whoami enock
ls is used to list the contents of a directory. Some options that can be added to ls are ; -l which prints out a long list, -a shows hidden files, -r sort listing in the reverse way, -t sort list by time (last modified)
enock@enock-pc:~$ ls -lt total 64 drwxr-xr-x 3 enock enock 4096 Jul 16 20:44 Desktop drwxr-xr-x 3 enock enock 4096 Jul 16 20:44 Downloads drwxr-xr-x 7 enock enock 4096 Jul 15 16:29 Documents drwxr-xr-x 6 enock enock 4096 Jul 14 00:52 Videos drwxrwxr-x 5 enock enock 4096 Jul 14 00:49 Code drwxr-xr-x 17 enock enock 4096 Jul 7 15:46 Music drwxr-xr-x 6 enock enock 4096 Jul 7 15:46 Pictures drwxrwxr-x 2 enock enock 4096 Jun 20 18:10 iso drwxrwxr-x 3 enock enock 4096 Jun 14 05:44 Mixxx
mkdir is used to create a new directory (new folder) ie.
pwd (print working directory) prints out the path of the current working directory.
enock@enock-pc:~$ pwd /home/enock
mv is used move (rename) files.
$ mv <old name> <new name>
man finds and displays the manual of a command.
$ man <command>
It also display its own manual. ie
enock@enock-pc:~$ man man
Changes working directory to the specified directory after cd. cd without any parameter changes directory to HOME directory of user.
$ cd <directory>
To move one step up the current directory, use:
$ cd ..
rm is used to remove or delete files. Removing a file on Linux is permanent, recovering it might be very difficult. Using options such as –r recursive and –f force are very dangerous. Always, the rm command is used in the format rm –i. The option –i prompts to see whether you are sure or not.
Type y for Yes or n for No and press Enter.
enock@enock-pc:~$ rm -i unixmen rm: remove regular file ‘unixmen’? y
This displays calendar, mostly the current month and day. It can also be used in addition with any year to view the full calendar of that year. ie $ cal 2013 , displays the full 12 months calendar for the year 2013.
enock@enock-pc:~$ cal July 2013 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Prints out the current date in a long format including time zone
enock@enock-pc:~$ date Wed Jul 17 05:27:07 GMT 2013