Linux Basic Commands Part-1
What is CLI?
CLI stands for Command Line Interface. This is a program where user is allowed to run text commands instructing the system to perform specific tasks.
Shell is a user interface responsible for processing all commands typed on CLI. It reads & interprets the commands given by the user and instructs the OS to perform the requested tasks.
Among many types of shell, the most popular ones are bash (for Linux and MacOS) and Windows shell or CMD.exe or the Command Prompt(for Windows). Linux’s shell is case sensitive.
BASH
Bash stands for Bourne Again SHell and was developed by the Free Software Foundation.
Below are the List of Basic Linux commands:
1. cd command
Helps to navigate through the Linux files and directories.
- cd .. (with two dots) to move one directory up
- cd to go straight to the home folder
- cd- (with a hyphen) to move to your previous directory
2. mkdir command
Use mkdir command to make a new directory
mkdir -p : It will create parent directory first, if it doesn't exist. But if it already exists, then it will not print an error message and will move further to create sub-directories. This command is most helpful in the case when you don't know whether a directory alredy exists or not.
3. rmdir command
If you need to delete a directory, use the rmdir command. However, rmdir only allows you to delete empty directories.
4. rm command
The rm command is used to delete directories and the contents within them. If you only want to delete the directory — as an alternative to rmdir — use rm -r.
5. touch command
The touch command allows you to create a blank new file through the Linux command line.
6. cp command
This command is used to copy files from the current directory to a different directory.
7. mv command
primary use of the mv command is to move files, although it can also be used to rename files.
8. cat command
cat (stands for concatenate)
It is used to list the contents of a file on the standard output (sdout).
9. ls command
The ls command is used to view the contents of a directory.
Variations which we can use with the ls command:
- ls -R will list all the files in the sub-directories as well
- ls -a will show the hidden files
- ls -al will list the files and directories with detailed information like the permissions, size, owner, etc.
10. pwd command
This command is used to find out the path of the current working directory
No comments:
Post a Comment