Basic Unix commands-3
11. uname command
Syntax: uname [options]
Description: Used to print system Information
-s prints the kernel name
-n print the network node hostname
-r prints the kernel release
-v print the kernel version
-m prints the machine hardware name
-o prints the operating system
12. bc command
It is used for command line calculator. It is similar to basic calculator.
Syntax: bc [option]
bc starts by processing code from all the files listed on the command line in
the order listed. After processing all the files bc reads from the standard
input. Code is executed as it is read.
-q To avoid bc welcome message
-l To include math library functionalities
quit
to quit the calculator.
13. tty Command
prints the file name of the terminal connected to standard input. It writes
the name of the terminal that is connected to standard input onto standard
output.
It does not require any additional argument
Syntax: tty
14. stty command
It sets certain terminal I/O modes for the device that is the current standard
input. Without arguments, it writes the settings of certain modes to standard
output.
Syntax: stty
15. cat Command
Main functions of cat commands are
- to create new files
- Display the contents of an existing file
- Concatenate the content of multiple files and display it.
syntax: cat [options] [file name]
Options
-b add line numbers to non blank lines
-e displays a $ (dollar character) at the end of each
line
-n add line numbers to all lines
-s removes all the blank lines and replace it to single
line.
-t show ^I instead of tabs.
#creating new file
cat > file-name.txt
Above syntax creates test.txt file and allow us to insert content in this file.
After inserting content you can use clt+d to exit the file.
If file with same name exist then it will overwrite that file.
After inserting content you can use clt+d to exit the file.
If file with same name exist then it will overwrite that file.
Combining two text files
cat test.txt file.txt
Comments