0% found this document useful (0 votes)
30 views

Some Userful Unix Commands With Examples

The document summarizes some common Unix commands, their definitions, and examples of using them. The commands covered include commands for viewing manual pages (man), changing directories (cd), listing files (ls), removing files and directories (rm, rmdir), getting file details (ls -l), copying and moving files (cp, mv), counting lines in a file (wc -l), creating and deleting directories (mkdir, rmdir), redirecting output (>, >>), concatenating files (cat), and changing passwords (passwd, clear).

Uploaded by

ejvar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Some Userful Unix Commands With Examples

The document summarizes some common Unix commands, their definitions, and examples of using them. The commands covered include commands for viewing manual pages (man), changing directories (cd), listing files (ls), removing files and directories (rm, rmdir), getting file details (ls -l), copying and moving files (cp, mv), counting lines in a file (wc -l), creating and deleting directories (mkdir, rmdir), redirecting output (>, >>), concatenating files (cat), and changing passwords (passwd, clear).

Uploaded by

ejvar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Some useful Unix Commands with examples

Cmd Man Cd Definition On Line Manual Change Directory Example Man cp Cd /xfer/P20/P2W Cd archive Ls List file Ls * Ls IW01004* Ls LOAD1 Ls l Rm Long list Remove Ls l *.ctl Rm JDT.FIL Rm JDT Wc IW01004* Wc l IW01004* Cp ABC.CTL ABC.JDT Cp ABC.CTl jim Mv ABC.CTL ABC.JDT Mv ABC.ctl archive Result Display details about the copy command Change to absolute directory (from root) Change to a directory archive that exists within the directory that the user is already in Lists all files and subdirectories in the current directory List any files in the current directory whose name starts with IW01004 If LOAD1 is a sub directory list all files in that sub directory Displays security, owner, group and size of the file Removes file JDT.FIL Removes directory JDT if it is in the current directory Lists number characters, number of words, number of lines of any files matching the criteria Lists number of lines of any files matching the criteria Copy the file ABC.CTL to ABC.JDT (both remain) If jim is a sub directory, makes a copy of the file in sub directory jim and keep is in the current directory Rename the file ABC.CTL to ABC.JDT (good way to rename a control file so that you you can rename it back later) If archive is a directory, this move the control file ABC.CTL to the archive sub directory. If the sub directory is not there, it will just rename the file to that name Creates the file named JDT.CTL in the current directory Creates file JDT in the specified directory no matter where you are currently located Creates a sub directory in the directory that you are in called Jim Deletes the directory and all files and sub directories in it called Jim (assuming that sub directory exists) Does a list of all files in the current directory and redirects (writes) the result into file myfiles (in this case a list of files in the current directory. Concatenate the data in all files in the current directory that start with abc.2001 and put that data into a single file named abc.fil Follow the commands and it will prompt you to change your password and confirm it. Screen will be blanked out with the cursor at the top of the screen

Wc Wc l Cp

Word Count Word count (line only) Copy

Mv

Move (or rename)

Touch

Create a file

Touch JDT.CTL Touch /sfer/P20/P2W/JDT Mkdir Jim Rmdir Jim Ls * > myfiles

Mkdir Rmdir >

Make a directory Remove a directory Redirect

Cat

Concatenate

Cat abc.2001* > abc.fil Passwd Clear

Passwd Clear

Change password Clears the screen

You might also like