[{"data":1,"prerenderedAt":593},["ShallowReactive",2],{"content-query-r4UKWK7U26":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":7,"tags":9,"body":10,"_type":587,"_id":588,"_source":589,"_file":590,"_stem":591,"_extension":592},"/tutorials/bash-101","tutorials",false,"","Bash 101","bash",{"type":11,"children":12,"toc":576},"root",[13,22,60,87,107,112,118,128,161,165,171,188,212,217,240,245,269,272,278,289,318,331,364,367,373,384,411,431,434,440,451,476,487,514,517,523,534,549,570],{"type":14,"tag":15,"props":16,"children":18},"element","h3",{"id":17},"bash-commands",[19],{"type":20,"value":21},"text","Bash commands",{"type":14,"tag":23,"props":24,"children":25},"p",{},[26,28,35,37,43,45,51,52,58],{"type":20,"value":27},"Once you are logged in to a Bash terminal, you can type commands to perform a number of tasks. A command is usually a single word, such as ",{"type":14,"tag":29,"props":30,"children":32},"code",{"className":31},[],[33],{"type":20,"value":34},"cd",{"type":20,"value":36}," or ",{"type":14,"tag":29,"props":38,"children":40},{"className":39},[],[41],{"type":20,"value":42},"ls",{"type":20,"value":44},", and it can include options that changes its functions, such as ",{"type":14,"tag":29,"props":46,"children":48},{"className":47},[],[49],{"type":20,"value":50},"ls -l",{"type":20,"value":36},{"type":14,"tag":29,"props":53,"children":55},{"className":54},[],[56],{"type":20,"value":57},"tar -xfv",{"type":20,"value":59},".",{"type":14,"tag":23,"props":61,"children":62},{},[63,65,70,72,77,79,85],{"type":20,"value":64},"Options often occur after dashes: ",{"type":14,"tag":29,"props":66,"children":68},{"className":67},[],[69],{"type":20,"value":50},{"type":20,"value":71}," runs the ",{"type":14,"tag":29,"props":73,"children":75},{"className":74},[],[76],{"type":20,"value":42},{"type":20,"value":78}," command (list all files in the current directory) with the options to output a long list of files (",{"type":14,"tag":29,"props":80,"children":82},{"className":81},[],[83],{"type":20,"value":84},"-l",{"type":20,"value":86},", outputs one file per line).",{"type":14,"tag":23,"props":88,"children":89},{},[90,92,98,99,105],{"type":20,"value":91},"Most commands also include the option ",{"type":14,"tag":29,"props":93,"children":95},{"className":94},[],[96],{"type":20,"value":97},"--help",{"type":20,"value":36},{"type":14,"tag":29,"props":100,"children":102},{"className":101},[],[103],{"type":20,"value":104},"-h",{"type":20,"value":106},". This options is useful to learn how to use a command, as well as to get more information about it.",{"type":14,"tag":23,"props":108,"children":109},{},[110],{"type":20,"value":111},"Next, we will go over some basic commands.",{"type":14,"tag":15,"props":113,"children":115},{"id":114},"listing-items-in-a-local-directory",[116],{"type":20,"value":117},"Listing items in a local directory",{"type":14,"tag":23,"props":119,"children":120},{},[121,126],{"type":14,"tag":29,"props":122,"children":124},{"className":123},[],[125],{"type":20,"value":42},{"type":20,"value":127},": Lists a directory, including file info and size in human-readable format.",{"type":14,"tag":129,"props":130,"children":133},"pre",{"className":131,"code":132,"language":9,"meta":7,"style":7},"language-bash shiki shiki-themes github-light monokai monokai github-light monokai","username@host:~$ ls -lh\n",[134],{"type":14,"tag":29,"props":135,"children":136},{"__ignoreMap":7},[137],{"type":14,"tag":138,"props":139,"children":142},"span",{"class":140,"line":141},"line",1,[143,149,155],{"type":14,"tag":138,"props":144,"children":146},{"style":145},"--shiki-default:#6F42C1;--shiki-dark-mode:#A6E22E;--shiki-sky-dark-mode:#A6E22E;--shiki-light-mode:#6F42C1;--shiki-blue-mode:#A6E22E",[147],{"type":20,"value":148},"username@host:~$",{"type":14,"tag":138,"props":150,"children":152},{"style":151},"--shiki-default:#032F62;--shiki-dark-mode:#E6DB74;--shiki-sky-dark-mode:#E6DB74;--shiki-light-mode:#032F62;--shiki-blue-mode:#E6DB74",[153],{"type":20,"value":154}," ls",{"type":14,"tag":138,"props":156,"children":158},{"style":157},"--shiki-default:#005CC5;--shiki-dark-mode:#AE81FF;--shiki-sky-dark-mode:#AE81FF;--shiki-light-mode:#005CC5;--shiki-blue-mode:#AE81FF",[159],{"type":20,"value":160}," -lh\n",{"type":14,"tag":162,"props":163,"children":164},"hr",{},[],{"type":14,"tag":15,"props":166,"children":168},{"id":167},"change-directory",[169],{"type":20,"value":170},"Change directory",{"type":14,"tag":23,"props":172,"children":173},{},[174,179,181,187],{"type":14,"tag":29,"props":175,"children":177},{"className":176},[],[178],{"type":20,"value":34},{"type":20,"value":180},": Changes the current directory of the shell to ",{"type":14,"tag":29,"props":182,"children":184},{"className":183},[],[185],{"type":20,"value":186},"/data/files",{"type":20,"value":59},{"type":14,"tag":129,"props":189,"children":191},{"className":131,"code":190,"language":9,"meta":7,"style":7},"username@host:~$ cd /data/files\n",[192],{"type":14,"tag":29,"props":193,"children":194},{"__ignoreMap":7},[195],{"type":14,"tag":138,"props":196,"children":197},{"class":140,"line":141},[198,202,207],{"type":14,"tag":138,"props":199,"children":200},{"style":145},[201],{"type":20,"value":148},{"type":14,"tag":138,"props":203,"children":204},{"style":151},[205],{"type":20,"value":206}," cd",{"type":14,"tag":138,"props":208,"children":209},{"style":151},[210],{"type":20,"value":211}," /data/files\n",{"type":14,"tag":23,"props":213,"children":214},{},[215],{"type":20,"value":216},"Changes to the directory one level above.",{"type":14,"tag":129,"props":218,"children":220},{"className":131,"code":219,"language":9,"meta":7,"style":7},"username@host:~$ cd ..\n",[221],{"type":14,"tag":29,"props":222,"children":223},{"__ignoreMap":7},[224],{"type":14,"tag":138,"props":225,"children":226},{"class":140,"line":141},[227,231,235],{"type":14,"tag":138,"props":228,"children":229},{"style":145},[230],{"type":20,"value":148},{"type":14,"tag":138,"props":232,"children":233},{"style":151},[234],{"type":20,"value":206},{"type":14,"tag":138,"props":236,"children":237},{"style":151},[238],{"type":20,"value":239}," ..\n",{"type":14,"tag":23,"props":241,"children":242},{},[243],{"type":20,"value":244},"Changes to the user's home directory.",{"type":14,"tag":129,"props":246,"children":248},{"className":131,"code":247,"language":9,"meta":7,"style":7},"username@host:$ cd ~\n",[249],{"type":14,"tag":29,"props":250,"children":251},{"__ignoreMap":7},[252],{"type":14,"tag":138,"props":253,"children":254},{"class":140,"line":141},[255,260,264],{"type":14,"tag":138,"props":256,"children":257},{"style":145},[258],{"type":20,"value":259},"username@host:$",{"type":14,"tag":138,"props":261,"children":262},{"style":151},[263],{"type":20,"value":206},{"type":14,"tag":138,"props":265,"children":266},{"style":151},[267],{"type":20,"value":268}," ~\n",{"type":14,"tag":162,"props":270,"children":271},{},[],{"type":14,"tag":15,"props":273,"children":275},{"id":274},"copying-a-file",[276],{"type":20,"value":277},"Copying a file",{"type":14,"tag":23,"props":279,"children":280},{},[281,287],{"type":14,"tag":29,"props":282,"children":284},{"className":283},[],[285],{"type":20,"value":286},"cp",{"type":20,"value":288},": Copy a file from to another directory.",{"type":14,"tag":129,"props":290,"children":292},{"className":131,"code":291,"language":9,"meta":7,"style":7},"username@host:~$ cp original_file.txt /data/files/new_file.txt\n",[293],{"type":14,"tag":29,"props":294,"children":295},{"__ignoreMap":7},[296],{"type":14,"tag":138,"props":297,"children":298},{"class":140,"line":141},[299,303,308,313],{"type":14,"tag":138,"props":300,"children":301},{"style":145},[302],{"type":20,"value":148},{"type":14,"tag":138,"props":304,"children":305},{"style":151},[306],{"type":20,"value":307}," cp",{"type":14,"tag":138,"props":309,"children":310},{"style":151},[311],{"type":20,"value":312}," original_file.txt",{"type":14,"tag":138,"props":314,"children":315},{"style":151},[316],{"type":20,"value":317}," /data/files/new_file.txt\n",{"type":14,"tag":23,"props":319,"children":320},{},[321,323,329],{"type":20,"value":322},"To copy a directory, include option ",{"type":14,"tag":29,"props":324,"children":326},{"className":325},[],[327],{"type":20,"value":328},"-r",{"type":20,"value":330},":",{"type":14,"tag":129,"props":332,"children":334},{"className":131,"code":333,"language":9,"meta":7,"style":7},"username@host:~$ cp -r original_folder /data/files/new_folder\n",[335],{"type":14,"tag":29,"props":336,"children":337},{"__ignoreMap":7},[338],{"type":14,"tag":138,"props":339,"children":340},{"class":140,"line":141},[341,345,349,354,359],{"type":14,"tag":138,"props":342,"children":343},{"style":145},[344],{"type":20,"value":148},{"type":14,"tag":138,"props":346,"children":347},{"style":151},[348],{"type":20,"value":307},{"type":14,"tag":138,"props":350,"children":351},{"style":157},[352],{"type":20,"value":353}," -r",{"type":14,"tag":138,"props":355,"children":356},{"style":151},[357],{"type":20,"value":358}," original_folder",{"type":14,"tag":138,"props":360,"children":361},{"style":151},[362],{"type":20,"value":363}," /data/files/new_folder\n",{"type":14,"tag":162,"props":365,"children":366},{},[],{"type":14,"tag":15,"props":368,"children":370},{"id":369},"moving-a-file",[371],{"type":20,"value":372},"Moving a file",{"type":14,"tag":23,"props":374,"children":375},{},[376,382],{"type":14,"tag":29,"props":377,"children":379},{"className":378},[],[380],{"type":20,"value":381},"mv",{"type":20,"value":383},": Moves a file to a destination.",{"type":14,"tag":129,"props":385,"children":387},{"className":131,"code":386,"language":9,"meta":7,"style":7},"username@host:~$ mv original_file.txt /data/files/new_file.txt\n",[388],{"type":14,"tag":29,"props":389,"children":390},{"__ignoreMap":7},[391],{"type":14,"tag":138,"props":392,"children":393},{"class":140,"line":141},[394,398,403,407],{"type":14,"tag":138,"props":395,"children":396},{"style":145},[397],{"type":20,"value":148},{"type":14,"tag":138,"props":399,"children":400},{"style":151},[401],{"type":20,"value":402}," mv",{"type":14,"tag":138,"props":404,"children":405},{"style":151},[406],{"type":20,"value":312},{"type":14,"tag":138,"props":408,"children":409},{"style":151},[410],{"type":20,"value":317},{"type":14,"tag":23,"props":412,"children":413},{},[414,416,422,424,429],{"type":20,"value":415},"You ",{"type":14,"tag":417,"props":418,"children":419},"strong",{},[420],{"type":20,"value":421},"do not",{"type":20,"value":423}," need option ",{"type":14,"tag":29,"props":425,"children":427},{"className":426},[],[428],{"type":20,"value":328},{"type":20,"value":430}," to move directories:",{"type":14,"tag":162,"props":432,"children":433},{},[],{"type":14,"tag":15,"props":435,"children":437},{"id":436},"deleting-a-file",[438],{"type":20,"value":439},"Deleting a file",{"type":14,"tag":23,"props":441,"children":442},{},[443,449],{"type":14,"tag":29,"props":444,"children":446},{"className":445},[],[447],{"type":20,"value":448},"rm",{"type":20,"value":450},": Deletes a file.",{"type":14,"tag":129,"props":452,"children":454},{"className":131,"code":453,"language":9,"meta":7,"style":7},"username@Host:~$ rm file.txt\n",[455],{"type":14,"tag":29,"props":456,"children":457},{"__ignoreMap":7},[458],{"type":14,"tag":138,"props":459,"children":460},{"class":140,"line":141},[461,466,471],{"type":14,"tag":138,"props":462,"children":463},{"style":145},[464],{"type":20,"value":465},"username@Host:~$",{"type":14,"tag":138,"props":467,"children":468},{"style":151},[469],{"type":20,"value":470}," rm",{"type":14,"tag":138,"props":472,"children":473},{"style":151},[474],{"type":20,"value":475}," file.txt\n",{"type":14,"tag":23,"props":477,"children":478},{},[479,481,486],{"type":20,"value":480},"To delete a directory, include option ",{"type":14,"tag":29,"props":482,"children":484},{"className":483},[],[485],{"type":20,"value":328},{"type":20,"value":330},{"type":14,"tag":129,"props":488,"children":490},{"className":131,"code":489,"language":9,"meta":7,"style":7},"username@host:~$ rm -r my_folder\n",[491],{"type":14,"tag":29,"props":492,"children":493},{"__ignoreMap":7},[494],{"type":14,"tag":138,"props":495,"children":496},{"class":140,"line":141},[497,501,505,509],{"type":14,"tag":138,"props":498,"children":499},{"style":145},[500],{"type":20,"value":148},{"type":14,"tag":138,"props":502,"children":503},{"style":151},[504],{"type":20,"value":470},{"type":14,"tag":138,"props":506,"children":507},{"style":157},[508],{"type":20,"value":353},{"type":14,"tag":138,"props":510,"children":511},{"style":151},[512],{"type":20,"value":513}," my_folder\n",{"type":14,"tag":162,"props":515,"children":516},{},[],{"type":14,"tag":15,"props":518,"children":520},{"id":519},"print-current-working-directory",[521],{"type":20,"value":522},"Print current working directory",{"type":14,"tag":23,"props":524,"children":525},{},[526,532],{"type":14,"tag":29,"props":527,"children":529},{"className":528},[],[530],{"type":20,"value":531},"pwd",{"type":20,"value":533}," outputs the absolute address of the current working directory.",{"type":14,"tag":129,"props":535,"children":537},{"className":131,"code":536,"language":9,"meta":7,"style":7},"pwd\n",[538],{"type":14,"tag":29,"props":539,"children":540},{"__ignoreMap":7},[541],{"type":14,"tag":138,"props":542,"children":543},{"class":140,"line":141},[544],{"type":14,"tag":138,"props":545,"children":547},{"style":546},"--shiki-default:#005CC5;--shiki-dark-mode:#66D9EF;--shiki-sky-dark-mode:#66D9EF;--shiki-light-mode:#005CC5;--shiki-blue-mode:#66D9EF",[548],{"type":20,"value":536},{"type":14,"tag":129,"props":550,"children":552},{"className":131,"code":551,"language":9,"meta":7,"style":7},"/home/\u003Cuser>/\u003Cmy_folder>/\n",[553],{"type":14,"tag":29,"props":554,"children":555},{"__ignoreMap":7},[556],{"type":14,"tag":138,"props":557,"children":558},{"class":140,"line":141},[559,564],{"type":14,"tag":138,"props":560,"children":561},{"style":145},[562],{"type":20,"value":563},"/home/",{"type":14,"tag":138,"props":565,"children":567},{"style":566},"--shiki-default:#24292E;--shiki-dark-mode:#F8F8F2;--shiki-sky-dark-mode:#F8F8F2;--shiki-light-mode:#24292E;--shiki-blue-mode:#F8F8F2",[568],{"type":20,"value":569},"\u003Cuser>/\u003Cmy_folder>/\n",{"type":14,"tag":571,"props":572,"children":573},"style",{},[574],{"type":20,"value":575},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark-mode .shiki span {color: var(--shiki-dark-mode);background: var(--shiki-dark-mode-bg);font-style: var(--shiki-dark-mode-font-style);font-weight: var(--shiki-dark-mode-font-weight);text-decoration: var(--shiki-dark-mode-text-decoration);}html.dark-mode .shiki span {color: var(--shiki-dark-mode);background: var(--shiki-dark-mode-bg);font-style: var(--shiki-dark-mode-font-style);font-weight: var(--shiki-dark-mode-font-weight);text-decoration: var(--shiki-dark-mode-text-decoration);}html .sky-dark-mode .shiki span {color: var(--shiki-sky-dark-mode);background: var(--shiki-sky-dark-mode-bg);font-style: var(--shiki-sky-dark-mode-font-style);font-weight: var(--shiki-sky-dark-mode-font-weight);text-decoration: var(--shiki-sky-dark-mode-text-decoration);}html.sky-dark-mode .shiki span {color: var(--shiki-sky-dark-mode);background: var(--shiki-sky-dark-mode-bg);font-style: var(--shiki-sky-dark-mode-font-style);font-weight: var(--shiki-sky-dark-mode-font-weight);text-decoration: var(--shiki-sky-dark-mode-text-decoration);}html .light-mode .shiki span {color: var(--shiki-light-mode);background: var(--shiki-light-mode-bg);font-style: var(--shiki-light-mode-font-style);font-weight: var(--shiki-light-mode-font-weight);text-decoration: var(--shiki-light-mode-text-decoration);}html.light-mode .shiki span {color: var(--shiki-light-mode);background: var(--shiki-light-mode-bg);font-style: var(--shiki-light-mode-font-style);font-weight: var(--shiki-light-mode-font-weight);text-decoration: var(--shiki-light-mode-text-decoration);}html .blue-mode .shiki span {color: var(--shiki-blue-mode);background: var(--shiki-blue-mode-bg);font-style: var(--shiki-blue-mode-font-style);font-weight: var(--shiki-blue-mode-font-weight);text-decoration: var(--shiki-blue-mode-text-decoration);}html.blue-mode .shiki span {color: var(--shiki-blue-mode);background: var(--shiki-blue-mode-bg);font-style: var(--shiki-blue-mode-font-style);font-weight: var(--shiki-blue-mode-font-weight);text-decoration: var(--shiki-blue-mode-text-decoration);}",{"title":7,"searchDepth":577,"depth":577,"links":578},2,[579,581,582,583,584,585,586],{"id":17,"depth":580,"text":21},3,{"id":114,"depth":580,"text":117},{"id":167,"depth":580,"text":170},{"id":274,"depth":580,"text":277},{"id":369,"depth":580,"text":372},{"id":436,"depth":580,"text":439},{"id":519,"depth":580,"text":522},"markdown","content:tutorials:bash-101.md","content","tutorials/bash-101.md","tutorials/bash-101","md",1793934184820]