{"id":1873,"date":"2019-02-01T20:07:31","date_gmt":"2019-02-01T20:07:31","guid":{"rendered":"https:\/\/cyflexdoc.wpengine.com\/linux-command-reference\/file-related\/"},"modified":"2019-02-16T02:49:33","modified_gmt":"2019-02-16T02:49:33","slug":"file-related","status":"publish","type":"page","link":"https:\/\/cyflex.com\/index.php\/linux-command-reference\/file-related\/","title":{"rendered":"File Related"},"content":{"rendered":"<table>\n<tbody>\n<tr>\n<th>Command<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>ls -al<\/td>\n<td>Displays all information about files\/directories. This includes displaying all hidden files as well<\/td>\n<\/tr>\n<tr>\n<td>pwd<\/td>\n<td>Shows current directory path<\/td>\n<\/tr>\n<tr>\n<td>mkdir directory-name<\/td>\n<td>Creates a directory<\/td>\n<\/tr>\n<tr>\n<td>rm file-name<\/td>\n<td>Deletes file<\/td>\n<\/tr>\n<tr>\n<td>cp file1 file2<\/td>\n<td>Copies linux files here file1 to file2<\/td>\n<\/tr>\n<tr>\n<td>mv file1 file2<\/td>\n<td>Moves files from one place to another\/renames file1 to file2<\/td>\n<\/tr>\n<tr>\n<td>ln -s \/path\/to\/file-name link-name<\/td>\n<td>Creates a symbolic link to file-name<\/td>\n<\/tr>\n<tr>\n<td>touch file<\/td>\n<td>Creates empty file<\/td>\n<\/tr>\n<tr>\n<td>cat file<\/td>\n<td>Prints the file content in terminal<\/td>\n<\/tr>\n<tr>\n<td>more file<\/td>\n<td>Display the contents of file<\/td>\n<\/tr>\n<tr>\n<td>head file<\/td>\n<td>Display the first 10 lines of file<\/td>\n<\/tr>\n<tr>\n<td>tail file<\/td>\n<td>Outputs the last 10 lines of file<\/td>\n<\/tr>\n<tr>\n<td>gpg -c file<\/td>\n<td>Encrypts file<\/td>\n<\/tr>\n<tr>\n<td>cksum file<\/td>\n<td>View the checksum of the file<\/td>\n<\/tr>\n<tr>\n<td>diff file1 file2<\/td>\n<td>View the differences between contents of file1 and file2<\/td>\n<\/tr>\n<tr>\n<td>ln -s link file<\/td>\n<td>Create a soft link named link to the file<\/td>\n<\/tr>\n<tr>\n<td>sort<\/td>\n<td>Sorts files in alphabetical order<\/td>\n<\/tr>\n<tr>\n<td>uniq<\/td>\n<td>Compares adjacent lines in a file and removes\/reports any duplicate lines<\/td>\n<\/tr>\n<tr>\n<td>wc<\/td>\n<td>Counts number of words\/lines<\/td>\n<\/tr>\n<tr>\n<td>dir<\/td>\n<td>Lists the content of the directory<\/td>\n<\/tr>\n<tr>\n<td>tee<\/td>\n<td>Command for chaining and redirection<\/td>\n<\/tr>\n<tr>\n<td>tr<\/td>\n<td>Command for translating characters<\/td>\n<\/tr>\n<tr>\n<td>rm -r directory-name<\/td>\n<td>Deletes directory recursively<\/td>\n<\/tr>\n<tr>\n<td>cp -r dir1 dir2<\/td>\n<td>Copies dir1 to dir2 creates dir2 if it doesn&#8217;t exist<\/td>\n<\/tr>\n<tr>\n<td>tail -f file<\/td>\n<td>Outputs the contents of file as it grows starting with the last 10 lines<\/td>\n<\/tr>\n<tr>\n<td>gpg file.gpg<\/td>\n<td>Decrypts file<\/td>\n<\/tr>\n<tr>\n<td>rm -f file-name<\/td>\n<td>Forcefully removes file<\/td>\n<\/tr>\n<tr>\n<td>rm -rf directory-name<\/td>\n<td>Forcefully removes directory recursively<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Command Description ls -al Displays all information about files\/directories. This includes displaying all hidden files as well pwd Shows current directory path mkdir directory-name Creates a directory rm file-name Deletes file cp file1 file2 Copies linux files here file1 to file2 mv file1 file2 Moves files from one place to another\/renames file1 to file2 ln [&hellip;]<\/p>\n","protected":false},"author":47,"featured_media":0,"parent":1712,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1873","page","type-page","status-publish","hentry"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/1873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/users\/47"}],"replies":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/comments?post=1873"}],"version-history":[{"count":0,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/1873\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/pages\/1712"}],"wp:attachment":[{"href":"https:\/\/cyflex.com\/index.php\/wp-json\/wp\/v2\/media?parent=1873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}