Changes between Version 28 and Version 29 of cypress/BasicLinuxComands
- Timestamp:
- 08/21/19 12:15:51 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
cypress/BasicLinuxComands
v28 v29 72 72 {{{ 73 73 [tulaneID@cypress1 ~]$ ls 74 woekshop74 hpc-workshop 75 75 [tulaneID@cypress1 ~]$ 76 76 }}} … … 84 84 }}} 85 85 86 Setting the ''-l''flag will display files along with their permissions and ownership.86 Setting the {{{-l}}} flag will display files along with their permissions and ownership. 87 87 {{{ 88 88 [tulaneID@cypress1 ~]$ ls -l hpc-workshop … … 132 132 {{{ 133 133 [tulaneID@cypress1 ~]$ rm hpc-workshop 134 }}} 135 If you would like to remove a directory and all of its contents use the following command: 134 rm: cannot remove `hpc-workshop': Is a directory 135 [tulaneID@cypress1 ~]$ 136 }}} 137 If you would like to remove a directory and all of its contents - with prompts for each directory and subdirectory - use the following command: 136 138 {{{ 137 139 [tulaneID@cypress1 ~]$ rm -ri hpc-workshop … … 141 143 [tulaneID@cypress1 ~]$ 142 144 }}} 143 ctrl+c to exit.144 145 The ''r'' flag specifies to remove files/directories recursively. ''i''specifies to prompt before deleting each file.146 147 If you are confident with the command line and your understanding of file locations you can use the ''f'' flag instead of ''i''to force deletion of all files without prompting:145 Use Ctrl+c to exit the prompts. 146 147 The {{{-r}}} flag specifies to remove files/directories recursively. {{{-i}}} specifies to prompt before deleting each file. 148 149 If you are confident with the command line and your understanding of file locations you can use the {{{-f}}} flag instead of {{{-i}}} to force deletion of all files without prompting: 148 150 {{{ 149 151 [tulaneID@cypress1 ~]$ rm -rf hpc-workshop … … 175 177 176 178 === cp === 177 Copy file to new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''.178 179 In the example below sourcefile already exists, and destinationfile may or may not exist and will become a copy of sourcefile.179 Copy file to new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS {{{-i}}} and {{{-n}}}. 180 181 In the example below '''sourcefile''' already exists, and '''destinationfile''' may or may not already exist and will become a copy of '''sourcefile'''. 180 182 {{{ 181 183 [tulaneID@cypress1 ~]$ cp sourcefile destinationfile 182 184 }}} 183 To copy a directory and all of its contents we use the recursive flag '''-r''':185 To copy a directory and all of its contents we use the recursive flag {{{-r}}}: 184 186 {{{ 185 187 [tulaneID@cypress1 ~]$ cp -r sourcedir destinationdir … … 188 190 Take note of the order here: source first, destination second. This is the standard order across most *nix commands. 189 191 === mv === 190 Move a file to a new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS '''-i''' and '''-n'''.192 Move a file to a new location. CAUTION: THERE IS NO UNDOING THIS COMMAND AS WELL - SEE ALSO OPTIONS {{{-i}}} and {{{-n}}}. 191 193 {{{ 192 194 [tulaneID@cypress1 ~]$ mv file1 file2 … … 231 233 [tulaneID@cypress1 ~]$ 232 234 }}} 233 The ''-f''flag can be used to tail a file interactively. New additions to the end of the file will be printed to your screen.235 The {{{-f}}} flag can be used to tail a file interactively. New additions to the end of the file will be printed to your screen. 234 236 235 237 === head === … … 283 285 }}} 284 286 285 Additionally, the behavior of the '''ls''' command can be modified by the addition of option flags. By default '''ls''' does not list any "hidden" files and subdirectories. To display all files and subdirectories one must add the ''-a''flag.287 Additionally, the behavior of the '''ls''' command can be modified by the addition of option flags. By default '''ls''' does not list any "hidden" files and subdirectories. To display all files and subdirectories one must add the {{{-a}}} flag. 286 288 287 289 {{{ … … 315 317 Display disk quotas. 316 318 317 The '-s'flag translates the output into a readable format. If your blocks column is equal to or greater than the quota column, you have exceeded your available disk space.319 The {{{-s}}} flag translates the output into a readable format. If your blocks column is equal to or greater than the quota column, you have exceeded your available disk space. 318 320 {{{ 319 321 [tulaneID@cypress1 ~]$quota -s … … 344 346 [tulaneID@cypress1 ~]$ 345 347 }}} 346 Use the ''-v''flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results.348 Use the {{{-v}}} flag to print out every line excluding those containing the search term. Notice that "dog" (lowercase) is missing from the results. 347 349 {{{ 348 350 [tulaneID@cypress1 ~]$ grep -v dog animals … … 355 357 [tulaneID@cypress1 ~]$ 356 358 }}} 357 The ''-i''flag will search without case-sensitivity.359 The {{{-i}}} flag will search without case-sensitivity. 358 360 {{{ 359 361 [tulaneID@cypress1 ~]$ grep -i dog animals … … 364 366 [tulaneID@cypress1 ~]$ 365 367 }}} 366 The ''-i'' and ''-v'' flagcan be combined to exclude all lines containing the search term regardless of capitalization.368 The {{{-i}}} and {{{-v}}} flags can be combined to exclude all lines containing the search term regardless of capitalization. 367 369 {{{ 368 370 [tulaneID@cypress1 ~]$ grep -iv dog animals … … 376 378 Searches for files in a directory hierarchy. The '''find''' takes a directory as an argument and will search in that directory and all of it's subdirectories for files that match the search criteria. If no directory is specified, the current directory is used. 377 379 378 You can search for a file by name using the '''-name'''flag as your search criteria380 You can search for a file by name using the {{{-name}}} flag as your search criteria 379 381 {{{ 380 382 [tulaneID@cypress1 ~]$ find /home/tulaneID/ -name file1.txt … … 452 454 453 455 === chmod === 454 The '''chmod''' commands allow a user to modify the permissions of files and directories that they own. To see the permissions of a file/directory we can use the '''ls -l'''command456 The '''chmod''' commands allow a user to modify the permissions of files and directories that they own. To see the permissions of a file/directory we can use the {{{ls -l}}} command 455 457 456 458 {{{