Basic Linux Commands
What is Linux ?
Linux is an open-source Unix operating system,Which is based on the Linux Kernel.Linux was first released in 1991, it has gained popularity for its open-source feature ,it means anyone can freely modify and redistribute it.
The most popular versions of Linux are Ubuntu ,Redhat , Fedora, Mint, Debian.Kali,Parrot More accurately, they’re called distributions or distros.
LINUX uses a shell, an interface that gives you access to the operating system’s services. Most Linux distributions use a graphic user interface (GUI) and shell,
The “cd” command is used to change the current working directory to a new working directory in Linux .The purpose of the command is the same as we are using in Windows.
cd command Syntax
cd [OPTIONS] directory
cd .. to move one directory up
cd to go the home folder
cd- t o move to your previous directory
The pwd command to find out the path of the current working directory. The command gives the output of the full path,
pwd -L: Prints the symbolic path.
pwd -P: Prints the actual path.
The ls command is used to view the list of contents of a directory.
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 in format
mkdir command to make a new directory
Mkdir [directory name(name of the directory you want to create)]
rm command to remove/delete directory along with its contains.
rm -i will ask before deleting each file.
rm -r will recursively delete a directory and all its contents
rm -f will forcibly delete files without asking
Grep is used for search through all the text in a given file.
Grep [(text you want to search)] [filename]
The full form of sudo is “SuperUser Do”, this command is used for perform tasks that require administrative or root permissions.
-h – help; displays syntax and command options
-V – version; displays the current version of the sudo application
-v – validate; refresh the time limit on sudo without running a command
-l – list; lists the user’s privileges, or checks a specific command
-k – kill; end the current sudo privileges
chmod is used to change the read, write, and execute permissions of files and directories.
Chmod [options] [mode] [filename]
the ping command to check your connectivity status of any network hosts
Ping [hostname/host ip address]
Man command is the most useful command in linux .It is the manual and the jurnal of the commands used in linux .you can find the details of any command along with its syntax.
Man [command name]