Basic Linux commands list with example and syntax for Beginners
Today’s topic helps you to understand the file systems as well as how we can manage it. So without wasting any time lets get started.
Listing files (ls) :
To list the files and directories within the current operating directory, we use the ls command. Actually, we will use the ls command to list the contents of any directory, not simply the present operating directory, and it will do several different fun things as well.
Note:
- Directories are denoted in blue color.
- Files are denoted in white.
Ls -al: It will show you the detailed list of the directories and files.
Ls -a: It is used to view hidden files.
Read Also: Hack Android Phone using Ngrok over internet
Creating & Displaying Files:
1. Creating the new file
Basically, ‘cat’ command is used to display text files, combining and creating new text files. Let’s have a look.
$cat > hackmingtxt
Enter the text
Ctrl+d for Linux user and volume down+d for termux users.
2. Displaying the file :
The command which we are using for creating a file the same cat command is used for displaying the text contained in the file.
$ cat < filename >
3. Combining 2 files:
$cat hackmingtxt hackmingtxt2 > Hackmingnew
Manipulating Directories:
The mv command performs both file moving and file renaming, depending on how it is used. In either case, the original filename no longer exists after the operation. mv is used in much the same way as cp:
To move or rename file or directory item1 to item2
$mv item1 item2
or
To move one or more items from one directory to another
Read also: How to write SMTP Brute Force Script using Python
Basic Commands:
chmod Command
chmod command is used to change/update file access permissions like this.
clear Command
clear command lets you clear the terminal screen, simply type.
cmp Command
cmp performs a byte-by-byte comparison of two files like this.
comm Command
comm command is used to compare two sorted files line-by-line as shown below.
ip Command
ip command is employed to show or manage routing, devices, policy routing and tunnels. It conjointly works as a replacement for documented ifconfig command.
$ sudo ip addr add 192.168.56.10 dev eth1
nmap Command
$ nmap -sV 192.168.23.0/24
grep Command
Grep Command searches for a specified pattern in a file (or files) and displays in output lines containing that pattern as follow:
Grep Command searches for a specified pattern in a file (or files) and displays in output lines containing that pattern as follow:
netstat Command
passwd Command
$ passwd hackming