LINUX COMMANDS ALL IN ONE
In this article, You can learn Linux commands. You can learn ls, cat, mv, sudo, rm, mkdir, rmdir, man, history, and clear commands.
To open the terminal, press Ctrl+Alt+T in Ubuntu, press Alt+T in Parrot OS or press Alt+F2, type in gnome-terminal, and press enter. In Raspberry Pi, type in lxterminal. There is also a GUI way of taking it, but this is better!
LINUX COMMANDS
> Copy and Paste in Terminal
Press " CTRL + SHIFT + C " for copy in Terminal.
Press " CTRL + SHIFT + V " for paste in Terminal.
There are several options for copy and pasting like Edit -> Copy, Paste.
> The Ls command
ls
Displays files in the current directory. Directories are shown in blue color and files are shown as white color.
ls </path>
Displays files in the given path.
ls -R
Listing Sub directories / Files. Use capital letter 'R'.
ls -al
Getting detailed file information.
First column shows File types & Access permissions, second column shows Memory blocks, third column shows owner of file, fourth column shows size in bytes, fifth column shows Date & Time, and sixth column shows Directory Names.
ls -a
Viewing hidden files. Hidden files start with '.' period symbol.
> The CAT command
It is used for creating & viewing files.
cat > filename
Enter some text values and press ctrl + d.
cat filename
It shows file contents in Terminal
cat filename_1 filename_2 > newfile
It concatenate two files into a new file called "newfile". After complition it does not show any confirmation message.
> The Rm command
rm <filename>
This command is used for deleting files. After completion it does not show any confirmation message.
rmdir <directoryName>
This command is used for deleting directories. Remeber that, Deleting sub-directories and files under the directory first.
> The Mv command
mv <FileName> <NewFileLocation>
To move file from current location to another location, this command is used. For running this command you have to enter as Super User mode.
mv <FileName> <NewFileName>
To rename a file you can use this command. This command requires two values i.e. file name and new file name.
mv <DirectoryName> <NewDirectoryName>
To rename a directory you can use this command. This command requires two values i.e. directory name and new directory name.
> The Sudo command
sudo mv <FileName> <NewFileLocation>
To move file from current location to another location, sudo command with mv command is used. After that, file name and file location is placed. This commands requires superuser password. This password still present in Terminal for 15 mins.
sudo !!
It re-runs the previous command.
This command is used for creating directories.
mkdir </path/new_directory_name>
This command is used for creating directory at a new location.
mkdir <dir1> <dir2> <dir3>
This command is used for creating multiple directories.
> The Man Command
Man stands for manual. The reference book for linux system. It is simple to Help file.
man <command>
This command used for getting all information of a command which is given.
> The History Command
history
Shows commands have used in the past.
> The clear command
clear
Clear the screen.
> The ifconfig command
ifconfig
ping works with both IPv4 and IPv6. Using only one of them explicitly can be enforced by specifying -4 or -6.
ping can also send IPv6 Node Information Queries (RFC4620). Intermediate hops may not be allowed, because IPv6 source routing was deprecated (RFC5095).
> The Cd command
The cd (“change directory”) command is used to change the current working directory in Linux and other Unix-like operating systems.
When specifying a directory to change to, you can use either absolute or
relative path names. The absolute or full path starts from the system
root /
, and relative path starts from your current directory.
cd <DirectoryName>
You can navigate to it by using the relative path to the directory.
You can also navigate to the same directory by using its absolute path:
cd </path/directoryName>
In short, if the path starts with a slash (/
) it is the absolute path to the directory.
cd ..
To switch the previous directory, from current directory. Suppose you are currently in the /usr/local/share
directory, to switch to the /usr/local
directory (one level up from the current directory), you would type "cd ..". To move two level up to the /usr directory, you could run the following: "cd ../../".
Comments
Post a Comment
Please do not enter any spam link in the comment box.