![]() |
|
Bash -- Basic command line navigation [Guide] - Printable Version +- Sinisterly (https://sinister.ly) +-- Forum: Hacking (https://sinister.ly/Forum-Hacking) +--- Forum: Tutorials (https://sinister.ly/Forum-Tutorials) +--- Thread: Bash -- Basic command line navigation [Guide] (/Thread-Bash-Basic-command-line-navigation-Guide) |
Bash -- Basic command line navigation [Guide] - pastezilla - 12-30-2015 This tutorial will teach some basic bash commands to help those new to unix / unix based systems how to navigate with bash. What is BASH? Bash standing for 'Bourne Again Shell' is basically a shell for UNIX. What is a shell? It's what gives an interface to an operating system. Either that meaning it being a graphical interface like unity is for ubuntu or gnome for linux mint, or simpily a command line interface like BASH is, bash is one of a few great CLI's. Okay, so what does bash do exactly? When you type bash commands into a terminal, bash is what interprets these commands and executes them. Let's get started! Now you have an idea of what bash is and what it can be used for let's LEARN some simple bash commands. The command can usally be opened on a linux operating system by pressing CTRL + T, it should look something like this. https://i.gyazo.com/357ee519cb50056fb5186a4ccf3d9d0e.png as you can see the name before the '@' symbol is the host, me being lazy left it as default which was root. Host is basically a user like how you'd have a user profile on windows. The name after the '@' is the name of the device, again i left it as default which was root, but i'm sure yours will look something like [name]@[PC_name]:~$ The '~' symbol means your in your home directory The '$' is to define what user you're logged in as. Anyway, moving on. Basic bash commands -- and what they mean: WARNING: THESE COMMANDS ARE THE BARE BASIC BASH COMMANDS, IF YOU'RE ON @roger_smith 'S LEVEL OF LINUX THIS GUIDE IS NOT FOR YOU. pwd - Print Working Directory Here you can see using the 'pwd' command it has given the directory i'm in, in this case it being root. https://gyazo.com/deb74f9d1c99e5ea53cfd57337e58ea0 ls - list's all files and or folders. Here you can see 'ls' has shown all the files in this 'root' directory https://gyazo.com/ba5accb63805da09811e58955fa996fa cd - changes directory Here you can see i changed directory using the 'cd' command (cd Desktop) and then requested to know my new directory using 'pwd' https://gyazo.com/6aa63ce92f83d5120fd4d0a3a0f6d737 It now shows I'm in the 'Desktop' Directory. I typed 'ls' to show the files on my desktop as i was in that directory but remembered i had nothing on my desktop, so i created a new folder for this guide. I then typed 'ls' again and it showed all files in my desktop directory (so whatever was on my desktop) that being the test file. https://gyazo.com/c6d76ff16b528e7b99a2845089d6f0a9 So you can start to see how this commands allow us to navigate our system? wget - tool for retrieveing content from web servers, also works for downlaoding via HTTP/HTTPS and FTP protocols Here you can see i used the 'wget' command to download the html code from sinister.ly, simply by typing wget (URL). You will also see in the picture index.html is on my desktop, that's because we used wget in the Desktop directory so we downloaded it TO the desktop directory, for example if we did "cd Downloads" then "get sinister.ly" it would be downloaded to our Downloads folder. https://gyazo.com/00cceddedaf8c55d1081ee39634aa575 Thanks for reading this basic bash guide, sorry for any spelling mistakes it's currently 1:06 for me and i've not had much sleep these past few days, plus i wrote this into a word doc and pasted it here so i had to re-read and re-select what i wanted BOLD etc. if you'd like i will post more guides on linux and even some on bash scripting. (only if requested and or wanted.) - Thanks for reading. RE: Bash -- Basic command line navigation [Guide] - Loki123 - 02-05-2016 You might want to format the post a bit better. Make it more readable, to me at least it is messy and here are my points on this. Quote: The '$' is to define what user you're logged in as. False, the sign at the end of the line has nothing to do with what user you are logged in as. Usually by default the PS1 line is username @ hostname : absolute_path $ The dollar sign here is a prompt, if the prompt exists, it means you can write a command. Sometimes root has # as its prompt, but that can vary from distribution to distribution in GNU/Linux. Quote: When you type bash commands into a terminal, bash is what interprets these commands and executes them. Oddly enough, this is partially correct only. If the program being invoked is a part of the shell commands, cd, pwd and echo for example, it executes them. If the program however isn't a part of the shell commands it doesn't execute it but invokes the kernel to initiate the execution those programs. And in the wget part, the command you posted is missing w in front of get. Quote:cd Downloads" then "get sinister.ly" it would be downloaded to our Downloads folder. You also might want to point out that, pwd, prints out the absolute path to where you are on the system. RE: Bash -- Basic command line navigation [Guide] - struikr0ver - 03-09-2016 thanks for sharing dude gonna check this out RE: Bash -- Basic command line navigation [Guide] - Cyber Warrior - 03-09-2016 Yeah pretty basic commands, helpful for beginners. Thanks. |