Cheatography
                https://cheatography.com
            
        
        
    
                   
                            
    
                    A cheat sheet for the Odin Project's early Linux fundamentals. See notes for practical lesson location.
                    
                 
                    
        
        
            
    
        
                                    This is a draft cheat sheet. It is a work in progress and is not finished yet.
                    
        
                
        
            
                                
    
    
            Directory Navigation
        
                        
                                                                                    
                                                                                            What?  | 
                                                                                                                        Command  | 
                                                                                                                        Description  | 
                                                                                 
                                                                                            
                                                                                            print working directory  | 
                                                                                                                         | 
                                                                                                                        displays current working directory  | 
                                                                                 
                                                                                            
                                                                                            Listing  | 
                                                                                                                         | 
                                                                                                                        list the contents of the current directory  | 
                                                                                 
                                                                                            
                                                                                            Listing -classify  | 
                                                                                                                         | 
                                                                                                                        classify the listing (directories, links, executables)  | 
                                                                                 
                                                                                            
                                                                                            L2use a command  | 
                                                                                                                         | 
                                                                                                                        displays more information on how to use the command or program.  | 
                                                                                 
                                                                                            
                                                                                            Listing + option + Argument  | 
                                                                                                                         | 
                                                                                                                        The argument Desktop tells ls that we want a listing of a specific directory  | 
                                                                                 
                                                                                            
                                                                                            change directory  | 
                                                                                                                         | 
                                                                                                                        The cd command is akin to double-clicking a folder in a GUI  | 
                                                                                 
                                                                                            
                                                                                            cd to parent  | 
                                                                                                                         | 
                                                                                                                        move up one directory level  | 
                                                                                 
                                                                                            
                                                                                            cd to previous  | 
                                                                                                                         | 
                                                                                                                        cd back and forth between current and last directory  | 
                                                                                 
                                                                                            
                                                                                            cd to home  | 
                                                                                                                         | 
                                                                                                                        (~) character at the start of a path = “the current user’s home directory”  | 
                                                                                 
                                                                         
                            
                             
 | 
    
    
            Directory Creation
        
                        
                                                                                    
                                                                                            What?  | 
                                                                                                                        Command  | 
                                                                                                                        Description  | 
                                                                                 
                                                                                            
                                                                                            Make directory  | 
                                                                                                                         | 
                                                                                                                        Make a new directory 'example' is created in the current working directory  | 
                                                                                 
                                                                                            
                                                                                            mkdir plus child directories  | 
                                                                                                                        mkdir -p ../example/a ../example/b
  | 
                                                                                                                        Create a directory with nested subdirectories in a single operation  | 
                                                                                 
                                                                                            
                                                                                            List all subdir  | 
                                                                                                                         | 
                                                                                                                        List everything in the indicated dir, including subdirectories. would show:   ../example/:   a/  b/    ../example/a:   ../example/b:
  | 
                                                                                 
                                                                                            
                                                                                            Create a file  | 
                                                                                                                         | 
                                                                                                                        Create a blank file in the specified format  | 
                                                                                 
                                                                         
                            
                             
 | 
            
                
                                                
                                
    
    
            Deleting, Moving & Copying
        
                        
                                                                                    
                                                                                            What?  | 
                                                                                                                        Command  | 
                                                                                                                        Description  | 
                                                                                 
                                                                                            
                                                                                            Move  | 
                                                                                                                        mv -i old.txt dir/new.txt
  | 
                                                                                                                        Moves file to new location  | 
                                                                                 
                                                                                            
                                                                                            Move (rename)  | 
                                                                                                                         | 
                                                                                                                        renames a file (with confirmation prompt)  | 
                                                                                 
                                                                                            
                                                                                            Move to current directory  | 
                                                                                                                         | 
                                                                                                                        Moves the specified file to the cd  | 
                                                                                 
                                                                                            
                                                                                            Copy a file or dir  | 
                                                                                                                        cp abc.txt letters/abcd.txt
  | 
                                                                                                                        Copy a file or directory to the specified location/filename.  | 
                                                                                 
                                                                                            
                                                                                            Copy a dir + all contents  | 
                                                                                                                         | 
                                                                                                                        recursive option -r, e.g. to back up a directory  | 
                                                                                 
                                                                                            
                                                                                            remove a file  | 
                                                                                                                         | 
                                                                                                                        removes the indicated file  | 
                                                                                 
                                                                                            
                                                                                            remove a folder  | 
                                                                                                                         | 
                                                                                                                        Removes the indicated folder by includinf recurside (-r), includes confirmation prompt (-i).   Warning no trash bin in linux, gone is gone!  | 
                                                                                 
                                                                         
                            
                             
                             | 
                                                                              | 
                                                        
                                
    
    
            Removing Files & Directories
        
                        
                                                                                    
                                                                                            What?  | 
                                                                                                                        Command  | 
                                                                                                                        Description  | 
                                                                                 
                                                                                            
                                                                                            remove a file  | 
                                                                                                                         | 
                                                                                                                        removes the indicated file  | 
                                                                                 
                                                                                            
                                                                                            remove a folder  | 
                                                                                                                         | 
                                                                                                                        Removes the indicated folder by includinf recurside (-r), includes confirmation prompt (-i).   Warning no trash bin in linux, gone is gone!  | 
                                                                                 
                                                                         
                            
                             
    
    
            Multi-file & multi-folder actions
        
                        
                                                                                    
                                                                                            What?  | 
                                                                                                                        Command  | 
                                                                                                                        Description  | 
                                                                                 
                                                                                            
                                                                                            Copy multiple files  | 
                                                                                                                        cp file1.txt file2.txt backup/
  | 
                                                                                                                        Copies the three specified files to the backup folder  | 
                                                                                 
                                                                                            
                                                                                            Wildcards *  | 
                                                                                                                         | 
                                                                                                                        * represents zero or more other characters. so in this case all .txt files  | 
                                                                                 
                                                                                            
                                                                                            Wildcard ?  | 
                                                                                                                         | 
                                                                                                                        ? represents exactly one character. So data1.txt AND data2.txt, but not data11.txt  | 
                                                                                 
                                                                         
                            
                             
                             |