Linux Commands I for beginners

in this post, I will tell you 10 basic Linux commands which you will use daily.

1. ls

The ls command - the list command - functions in the Linux terminal to show all of the major directories filed under a given file system.


The ls command is used for viewing files, folders, and directories.
2. cd

The cd command - change directory - will allow the user to change between file directories. As the name command name suggests, you would use the cd command to circulate between two different directories.
this command is mainly used with ls command. ls command list the directory and cd help in navigation. 
e.g. if you want to navigate to a folder linux which is inside Pictures and Pictures is inside Home.
cd - change directory



or you may directly navigate like






3. mv


The mv command - move - allows a user to move a file to another folder or directory.
Syntax: 



mv /source /destination



E.g. i want to move linux to desktop. since my linux folder is inside Pictures so my source will be Pictures




4. man


The man command is used to show the manual of the inputted command. Inputting the man command will show you all information about the command you are using. An example:
man ls
manual page of ls
 

5. mkdir


The mkdir - make directory - command allows the user to make a new directory.
Syntax:

mkdir test

The example command made the directory "test".
6. rmdir


The rmdir - remove directory - command allows the user to remove an existing command using the Linux CLI. 

Syntax
rmdir test


you will not notice "test" folder which we have created using mkdir command

It should be noted: both the mkdir and rmdir commands make and remove directories. They do not make files and they will also not remove a directory which has files in it. The mkdir will make an empty directory and the rmdir command will remove an empty directory.
7. touch


The touch command allows users to make files using the Linux CLI. 
Just as the mkdir command makes directories, the touch command makes files.  
An example of the touch command:
touch testfile.txt






8. rm


The rm command - remove - like the rmdir command is meant to remove files from your Linux OS. 
rmdir will remove directories and files held within and rm command will delete created files.
Syntax: 
rm testfile.txt



Note:
The rmdir command will only delete an empty directory, the rm command will remove both files and directories with files in it.

9. locate

The locate command is meant to find a file within the Linux OS.

A locate command example:
locate -i *red*house**city*


The stated command will locate an file with the a file name containing "Red", "House" and "City". 

A note on the input: the use of "-i" tells the system to search for a file unspecific of capitalization (Linux functions in lower case). The use of the asterik "*" signifies searching for a wildcard. A wildcard tells the system to pull any and all files containing the search criteria.
By specifying -i with wildcards, the locate CLI command will pull back all files containing your search criteria effectivley casting the widest search net the system will allow.

10. clear


The clear command does exactly what it says. When your Linux CLI gets all mucked up with various readouts and information, the clear command clears the screen and wipes the board clean. Using the clear command will take the user back to the start prompt of whatever directory you are currently operating in. To use the clear command simply type clear.

Related Posts Plugin for WordPress, Blogger...