{"id":322,"date":"2012-10-12T12:22:57","date_gmt":"2012-10-12T12:22:57","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=322"},"modified":"2023-12-06T12:17:31","modified_gmt":"2023-12-06T12:17:31","slug":"file-system-general","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/command-line\/file-system-command-line\/file-system-general","title":{"rendered":"File System General"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">General<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>Up and Down cursor keys\nSelect previous commands\n\n --help\nUse after a command to get help on its options<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Directories<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>cd some_directory_name\nGo to directory\n\ncd\ncd ~\nGo to $HOME directory\n\ncd ..\nGo up a directory\n\ncd -\nGo to previous directory\n\npwd\nWhere am I - show current directory\n\nls\nList contents of directory\n\nls -alh\nWhat's here - list all files and folders\n\nmkdir my_directory_name\nMake a directory\n\nsudo rm -r my_directory_name\nDelete a directory and any files it contains<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Files<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>rm somefilename.*\nRemove file or files\n\ncp existing_file.txt new_file.txt\nCopy file\n\ncp \/some_folder\/existing_file.txt .\nCopy file to current working directory\n\n\nwget http:\/\/downloads.somedomain.com\/...\nDownload file<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Move or rename file<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>mv {old-dir-name} {new-dir-name}<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">Move all files<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>\"mv \/path\/sourcefolder\/* \/path\/destinationfolder\/\"\n\n\"mv \/path\/sourcefolder\/*.txt \/path\/destinationfolder\/\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>General Directories Files Move or rename file Move all files<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[133],"tags":[],"class_list":["post-322","post","type-post","status-publish","format-standard","hentry","category-file-system-command-line"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=322"}],"version-history":[{"count":24,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":3689,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/322\/revisions\/3689"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}