15 Essential Linux Commands which the new Linux user Should know
Open a Terminal, give the key combination
Ctrl + Alt + T
or in Ubuntu 18.04.2 LTS (Bionic Beaver) top above left on the corner on icon click
on the window "Type to search..."
1. pwd - Whre I am
pwd is the abrevation of print working directory .You can read more information about it, here. The command pwd print the full filename of the current working directory.
2. cd - Changing Directories with cd
To change directories from the terminal, use the change directory command, cd. Here an example of how to switch to /Pictures directory.
3. ls - List directory contents
To see the contents of a directory (the files and subdirectories), we can use the ls (list) Command. That is very similar to the dir command in Windows.
4. ls -l - Search to the permission of owner, size and when they were modified
5. locate - Searching with locate , this command will go through your entire filesystem and locate every occurrence of that word.
which - Searching with which. The which command is even more specific: it only returns the location of the binaries in the PATH variable in Linux.
6. find - The find command is the most powerful and flexible of the searching utilities. It is capable of beginning your search in any designated directory and looking for a number of different parameters, including, of course, the filename but also the date of creation or modification, the owner, the group, permissions, and size.
Syntax for find:
find directory options expresion
linux@linuxusers:~$ find /¹ -type f² -name firefox³
1- First, I state the directory in which to start the search, in this case /.
2- Then I specify which type of file to search for, in this case f for an ordinary file .
3- Last, I give the name of the file I’m searching for, in this case, Firefox.
7. whatis - The whatis command provides very brief descriptions of a Programm, it to say what does it, more info what whatis does, here.
8. ps aux - The ps aux command Display the processes/programs on the Computer. That provides yours a listing of all the processes running in this system.
9. ps aux | grep Programm/Process - The ps aux | grep Programm/process command display Information about this Programm/Process. When you to want to see if a Process is running. I can do this by piping the output from ps to grep and searching for a keyword. For example, to find out whether the Firefox service is running, I would enter the following command, linux@linuxusers:~$ ps aux | grep firefox .
10. kill - The kill command is used to terminate a processes manuality.
How to kill a Process:
An example: You Firefox is crash, and you will kill it.
Step 1 - Find out the PID of the Firefox. With linux@linuxusers:~$ ps aux | grep firefox you find the PID number,
Step 2 - Kill the process using the PID number from Firefox, it is 1590 , With Root kill it.
linux@linuxusers:~$ sudo kill 1590
11. whoami - With the command whoami display my username, linux@linuxusers:~$ whoami .
12. passwd - With the command passwd can Password from username change , with Root + passwd + my usarname, linux@linuxusers:~$ sudo passwd linux
1. - Give you current usarname Password
2. - Give you New Password
3. - repeat it
13. lsblk - The lsblk command reads all or the specified Block devices. The lsblk command reads the sysfs filesystem to gather information , more Information about lsblk is here
14. df - The df command display how many places have on my Partitions and Hard Disk.
because sometimes indication of size is difficult to see how many places have, with df -lh making it easy to show....
15. shutdown - The shutdown command bring the system down in a secure method .
- shutdown now - put down the system immediately .
- linux@linuxusers:~$ shutdown now
- shutdown -h 30 - put down your computer on 30 minutes .
- linux@linuxusers:~$ shutdown -h 30
- reboot - reboot you Computer immediately .
- linux@linuxusers:~$ reboot