110 likes | 216 Vues
Learning basic Unix command. It 325 operating system. Making Directories. mkdir (make directory) We will now make a subdirectory in your home directory to hold the files you will be creating. To make a subdirectory called unixstuff in your current working directory type
E N D
Learning basic Unix command It 325 operating system
Making Directories • mkdir(make directory) • We will now make a subdirectory in your home directory to hold the files you will be creating. To make a subdirectory called unixstuff in your current working directory type • % mkdirunixstuff • To see the directory you have just created, type: • % ls
Changing to a different directory • cd (change directory) • The command cd directory means change the current working directory to 'directory'. The current working directory may be thought of as the directory you are in, i.e. your current position in the file-system tree. • To change to the directory you have just made, type • % cd unixstuff • Type ls to see the contents (which should be empty)
Changing to a different directory • (..) means the parent of the current directory, so typing • % cd .. • will take you one directory up the hierarchy (back to your home directory). • Note: typing cd with no argument always returns you to your home directory. This is very useful if you are lost in the file system.
print working directory • pwd (print working directory) • % pwd
Some Utilities • The Arrow Keys : • Use to retrieve previous commands. • History : ( %history ) • Use to get a list of the commands you have used most recently • "!10" to repeat command number 10. • "!n". This will re-issue the most recent command that begins with the prefix “n". Note that the prefix can be of any length • Find: • Find the path name of a file (% find / -name filename )
Some Utilities • Rmdir • remove directory. example :Rmdir /home/user/new will remove “new” directory. • cp filename1 filename2 • copy a file or directory( this command will copy “filename1” content to “filename2” • rmfilename • remove a file (delete it)
Displaying Text Files we saw that cat can be used for this purpose, but it is most useful for short files that can be viewed all on one screen. what about large file?
The Manual • Linux includes an on-line help system, called the manual. • Type: "man cat" to read about cat
Directomary and File Permissions • File user's are divided into three categories: • User, group and everyone else • They might have permission to read a file, write or modify a file and execute a file. • Setting Permissions: • You can set the permissions of the files using the chmod • 4 for read, 2 for write, 1 for execute. • 6 = 4+2 (read plus write permission) • 7 = 4+2+1 (all three permissions added together) • chmod 755 filethe user has full permissions while the others can read and execute but not write .