To allow anyone who has access to the directory in which myfile is stored to read or execute myfile, enter: chmod o+rx myfile To allow yourself to execute a file that you own named myfile, enter: chmod u+x myfile These categories are abbreviated as u for owner (or user), g for group, and o for other. These permissions are broken down for three categories of user: first, the owner of the file second, a group with which both the user and the file may be associated and third, all other users. Every file (including directories, which Unix treats as files) on a Unix system is stored with records indicating who has permission to read, write, or execute the file, abbreviated as r, w, and x. This command changes the permission information associated with a file. To return to your home directory, enter: cd chmod To move to the root directory, enter: cd / To move to the parent directory of the current directory, enter: cd. To switch to a directory named /home/dvader/empire_docs, enter: cd /home/dvader/empire_docs To switch to a subdirectory (of the current directory) named myfiles, enter: cd myfiles By default, your Unix login session begins in your home directory. This command changes your current directory location. Use the less command (described below) or an editor for reading longer text files.įor more, see Combine several text files into a single file in Unix. To view the contents of a file named myfile, enter: cat myfileīecause cat displays text without pausing, its output may quickly scroll off your screen. To append file1 onto the end of file2, enter: cat file1 > file2 You can use it to read brief files or to concatenate files together. This command outputs the contents of a text file. To show a calendar for just the month of June 1970, enter: cat To show a twelve-month calendar for 2008, enter: cal 2008 To show this month's calendar, enter: cal This command will print a calendar for a specified month and/or year.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |