sort
sort command is used to sort the data inside the file.
If we don't mention any options it will sort the lines which begin with
- Empty Lines
- Numerical Values
- Alphabetical Order
Syntax of sort command
sort [ options ] filename
These are some of the options used along with sort command
-b To ignore leading spaces
-d To sort in dictionary order
-f Converts all lower case to upper case while comparing
-r To reverse sort
-M To sort according to months
Examples
sort -b filename
sort -db filename
date
date command is used to display the date and time on the system and also to set the date and time.
Syntax of date command
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Example
To print the date and time
date
Options with date command
-s To set the date and time
-d To display time described by input string
tree
tree command displays the directories and files in a tree like structure.
Syntax
tree [options]
Example
To print the directories and files in tree like structure
tree
Options used with tree
-a All files are listed
-d Only directories are listed
-f Prints the full path for each file
-o Output to given file istead of stdout
wc
wc command is used to count newlines, words and characters in a file
Syntax
wc [OPTION] [FILE]
Example
To print the word count in a file
wc filename
Options used with wc command
-w Prints word counts
-c Prints character counts
-b Prints byte counts
-l Prints new line counts
ping
ping command is used to check network connection between host and server/host.
Along with ping we use ip address of a host or url.
Syntax
ping [options] <destination>
Options
-c Stop after count replies
-l Send preload number of packages while waiting replies
-s Use size as number of bytes to be sent
-W Time to wait for response
Example
ping -c 3 www.facebook.com
ifconfig
Ifconfig is used to configure the kernel-resident network interfaces.
It is used at boot time to set up interfaces as necessary.
After that, it is usually only needed when debugging or when system tuning is needed.
Syntax
ifconfig [-a] [-s] [interface]
Options
-a Displays all the interfaces available
-s Displays short list instead of details
Example
ifconfig -s
ssh
ssh is a program for logging into a remote machine and for executing commands on a remote machine.
It is intended to provide secure encrypted communications between two untrusted hosts over an insecure network.
Syntax
ssh username host
- username represents the account that is being accessed on the host.
- host refers to the machine which can be a computer or a router that is being accessed.
Top comments (0)