tail: use tail to see the end of the file structure the command the way that the head command is structured directly above.head -n 20 : see the first 20 lines change the number to see more or less lines.Sometimes, you will have to enter the next letter hit TAB again, especially if there are spaces in your filename.ĭON’T PUT SPACES OR APOSTROPHES IN YOUR FILE NAMES.īesides using cat to see the entire file, you can also take a peak at the beginning or end of a file. TIP: If pressing TAB does not autocomplete your folder or filename, then you may need to enter a few more letters to disambiguate which folder or file you mean.Īlso, make sure that autocomplete gave you the ENTIRE folder or file name. Typing the file name is super annoying though - write cat and then hit TAB to autocomplete the filename. pwd to check you’re in the right place!.cd ~/Downloads to change directory into your Downloads folder.In class, we downloaded a file from Slack to test out our new commands! Extract the zip file, and then: File and folder names have to be typed exactly as is! cd desktop and cd Desktop are different (you probably want to use the latter).clear will do exactly as it sounds your Terminal/Babun shell will be cleared of all commands and output.If your command line is running something it shouldn’t be, use Ctrl+C to escape/exit.cd : it’ll autocomplete the path to that folder! This only works on Macs.cd ~/Downloads: takes you directly to your Downloads folder.cd ~: takes you directly to your home directory.When you see ~ in terminal, it means you’re in your home directory.You can use a bunch of flags together ls -lh or ls -lha.-a: all, shows you hidden files, usually important stuff your computer doesn’t want you to deal with.-h: makes the displayed filesize numbers human readable!.-l: displays more information about your files and folders (you’d enter it as ls -l in your shell).A few helpful flags to add to the ls command: You can add flags to commands to instruct shell to do specific things or structure its output in a specific way.are really helpful when you are moving around your computer using the command line. I’ve compiled a ton of common shell commands! I won’t repeat them all here now, but remember pwd, ls, cd, cd. You might also hear folks referring to the command line as the shell, Terminal (on Mac) or PowerShell (on Windows). We’ve already (maybe) used it to install Python 3, pip, virtualenv and virtualenvwrapper during orientation ( if you haven’t done that, go do that now). The command line is a more intimate way of interacting with your computer (than say, Finder on Mac or Explorer on Windows). Command Line & Python Basics The Command Line
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |