![]() In addition to its searching capability, the grep command can be used in combination with other commands to act as a filter. (This doesn’t even begin to touch on the power of grep and its many uses. The -i argument indicates the search is to disregard cASe, the -n instructs to show the corresponding line number, and -w tells it to match only based on the whole word. (You can also explore using the locate command - type info locate and/or man locate for usage information.)Ĭan be used to locate text in a specific file or directory of files (use * in place of filename to search all of the files in the current directory). The example given will find all file and directory names within the current directory and subdirectories of it that begin with the letter n. It can also be used to display directories. The find command can be used to locate files or a group of files. Results in two copies of the files on your account one copy in the existing directory and another in the destination directory. Make sure you have created the destination directory before trying to copy files to it - see mkdir above. Will copy the contents of one directory to another directory. Will copy the contents of one file to another file, resulting in two copies of the same file on your account. To list all files and directories in long format by time modified, type ls -lta. To list all directories and files, sorted by size, in long format, type ls -lS. To list all files and directories in long format which will provide details about each file and directory, type ls -la. To see a more complete list which includes hidden files or files that begin with a “.” (dot), type ls -a. To display a list of files and subdirectories in your current directory, type ls (”list”) To delete an empty directory, type rmdir (”remove directory”) and the directory’s name. To create a new directory, type mkdir (”make directory”) and specify the new directory’s name. To see which directory you are in, type pwd (”print (display) working directory”). ![]() moves you up one directory from your current location. If it is a subdirectory of the current directory, you can just type the directory name. To change to a specific directory, type cd followed by the path to the directory. When typed by itself, cd (”change directory”), will take you back to your $HOME directory ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |