[email protected] Bash (Bourne-again Shell) What is SFTP? Bash is a shell for the GNU operating system. Its features Secure File Transfer Protocol is a protocol that uses SSH Notice: These are very basic, and not all commands nor include tab completion and unlimited command history, and lets you manage, access, and transfer your files are all the uses of the commands listed here. This is for a accessible by the up and down arrows. To get into the securely over a network. beginner's quick reference, and has some tips and tricks bash shell, simply type bash at the command prompt. To for starting out. get out of bash shell, simply type exit. SFTP Commands cd change directory What is SSH? Basic Linux Commands dir/ls display remote directory listing Secure Shell is a protocol used to remotely access your bash changes to bash shell exit/quit/bye quit sftp shell account, proxy, etc. securely over a network. cat [files] display or concatenate files get [r-path] [l-path] download file cat [file1] >> [file2] append file1 to file2 help/? display help text Connecting using SFTP or SSH cd change directory lcd change directory [locally] sftp [username]@[remote-path] cp[file] [path] copies a file to designated path lls display local directory listing ex: sftp [email protected] diff [file1] [file2] compares two files, shows diff lmkdir make directory [locally] exit exits out of shell lpwd print local directory listing ssh [username]@[remote-path] find [path] -name [file] returns full path of file mkdir make directory [remotely] ex: ssh [email protected] g++ [file.cc] compiles your c++ programs put [l-path] [r-path] upload file grep [pattern] [file] searches through files for pattern pwd print remote working directory Wildcard Characters head [file] displays first 10 lines of file rename [old] [new] rename remote file The asterisk * represents any amount of characters. history displays command history rm remove remote file g++ *.cc says, “g++, compile all of my .cc files please” kill -9 [process id] kills process by pid rmdir remove remote directory The question mark ? represents exactly one character. less [file] lets you scroll through output ! escape to local shell ls file.??? says, “list all files with a 3 character ext lpr [file] send file to printer ![command] execute command in local shell man [command] reference page for command Terminology mkdir [dir name] creates a directory Using text editors remote path/r-path – path of remote computer passwd changes password Text editors are programs that are used to edit files. There local path/l-path – path of computer you are on ps shows active processes are many that you can use, such as: emacs, gedit, nano/pico Bracketed words – are in place of strings, do not include pwd print working directory and vi/vim. To use these, simply type the editor name, brackets when you type commands in rm [file] remove file followed by the file name - emacs file.cc & which rmdir [directory] remove [empty] directory will open an existing or create a new file with that name. Redirecting standard input and output tail [file] displays last 10 lines of file The pipe operator | feeds the output of one command to top shows top 15 system processes Warning about closing terminal windows the input of another. For example, history | grep which [command] shows full path of shell commands If you close a terminal window that you are currently using ssh will output any line in your command history where to run a program (for instance, gedit) it will close down all Running files in the background processes associated with that terminal window. Be careful the string ssh occurs. to remember what you used it for and save often! The output redirection operator > will direct the output of When opening things from a terminal, you notice that if a command into a file. If the file does not exist, it will you type in the command line, gedit, you will no longer be able to run commands in your terminal. Instead, References create it, if it does, it will overwrite the old file. "User Commands."Ubuntu 10.04.3 LTS, LucidLynx, Man Another output redirection operator >> directs the output type gedit & the ampersand '&' tells it to run in the Page Tomb, Date: Man Page Reference. Shell. Date of a command into a file, but instead appends to the file. background. Using this method, you can run multiple programs and still retain the use of your command line. Accessed: January 29, 2012.