Skip to content

Files

Latest commit

 

History

History
66 lines (43 loc) · 1.97 KB

UnixCommands.md

File metadata and controls

66 lines (43 loc) · 1.97 KB

Unix Commands

$date -> displays both date and time

It has many format specifiers

syntax Description
d The day of the month
y The last two digits of the year
H,M and S The hour,minute and second respectively
D The date in the format mm/dd/yy
T The time in format hh:mm:ss

$cal -> displays the calender of the year

$who -> displays all the users of the computer

$ps -> to view all the processes that are going on

$wc command_name -> counts the number of characters

$type command_name -> tells whether a particular command is internal or external command

$echo -> displays message on the console

$uname -> tells certain features of Operating System running on the machine

$tty -> displays device name on your terminal

$pwd -> displays the present working directory

$ls -> lists all the files and directories

Options to ls

Option Description
-x Multicolumnar Output
-F Marks executable with *, directories with / and symbolic links with @
-a Shows all filenames beginning with a dot including . and ..
-R Recursive list
-r Sorts filenames in reverse order
-l Long listing in ASCII collating sequence showing seven attributes of a file
-d dirname Lists only dirname if dirname is a directory
- t Sorts filenames by last modification time
-lt Sorts listing by last modification time
-u Sorts filenames by last access time
-lu Sorts by ASCII collating sequence but listing shows last access time
-lut Sorts by last access time
-i Displays inode number

$mkdir directory_name -> make a new directory

$rmdir directory_name -> removes that particular directory

$cd -> helps to switch between different directories

$cat -> displays contents of the file

$cp file1 file2 -> copies the contents of file1 to file2

$rm file1 -> deletes the files

$mv file1 file2 -> renames file1 to file2