unix made easy

2
Logged in = What to do Who= who logged into the system The users and hosts Pwd = print woring directory= lists the current working directory Ls = lists all the directories files and sub directories –f –r and other options to remove the unwanted expressions that also come in the result Handling Files Head [ -10] file1 = Shows the first 10 lines of the file More file1= Shows more content of the file Tail file1 = Shows the lasat few lines of the file Ed file1 = Editor for the file to create/edit Sed = Stream editor for editing the file Vi = Editing the file and saving it Mv file1 to file2 = Move the file into another Cp file1 file2 = Write contents od file1 into file2 Awk file1 = Search for patterns in the file and process the results Handling Directories Chown = Change ownership of the Chmod = Change file or directory access permissions

Upload: sunil-kumar-gunasekaran

Post on 20-Jan-2015

156 views

Category:

Documents


4 download

DESCRIPTION

Unix Notes

TRANSCRIPT

Page 1: Unix made easy

Logged in = What to doWho= who logged into the system The users and hosts Pwd = print woring directory= lists the current working directory Ls = lists all the directories files and sub directories –f –r and other options to remove the unwanted expressions that also come in the result

Handling FilesHead [ -10] file1 = Shows the first 10 lines of the fileMore file1= Shows more content of the file Tail file1 = Shows the lasat few lines of the fileEd file1 = Editor for the file to create/editSed = Stream editor for editing the file Vi = Editing the file and saving it

Mv file1 to file2 = Move the file into another Cp file1 file2 = Write contents od file1 into file2 Awk file1 = Search for patterns in the file and process the results Handling DirectoriesChown = Change ownership of the Chmod = Change file or directory access permissionsMkdir = Creating new directory Rmdir = Removing the directory Handling Processes Ps = show the active processes involved Kill #pid = kill the process with specified pid

String Manipulation Commands

Page 2: Unix made easy

Grep ‘search string’ file1 = Search for the occurance of the string in the fileWc file1 = Find the number of words in the file

Server Connection Commandstelnet [host port ] =Used to communicate with other hosts present in the server. ftp host = Transfer files using file transfer protocol