Sign in to follow this  
Followers 0
sshsilver

Shell commands

10 posts in this topic

Hi

I was recently using BASH on my home computer trying to explore / understand the commands. A friend had kindly pointed me to a site with 1000s of commands and explenations of their use. I was also informed that by hitting the 'tab' key twice in the shell, a long list of available commands would reveal itself. To me this was a very exciting moment! Only until I saw the sheer quantity of commands there were...

It asked me "Display all 993 possibilities (y or n)"

993? Yikes!

My question is, for a beginner, what commands would you focus on to improve navigation and exploration? I am trying to sift through the commands but any advice to which are more useful than others, would certainly help!

Thanks for your time.

0

Share this post


Link to post
Share on other sites

The two most important: man and apropos.

man followed by a command name will give you a detailed explanation of what the command does and how to use it.

apropos followed by a keyword will give you all commands related to that keyword (and a brief explanation of what it does).

Knowing these two commands will allow you to find the information you need even if you don't know exactly what it is you need to know.

Beyond that,

ls - list files

cd - change directory

mv - move file (rename)

cp - copy file

mkdir - make directory

rm - remove file (-r for directory [recursive delete])

cat - echo the contents of a file to the screen (it does more than that, but for beginners...)

grep - filter text results (I urge you to read the manpage for this one. execute 'man grep' for that)

As for tab completion, it is very useful. You can start typing a command and then tab complete it (or have it give you a narrowed down list of options).

Edited by n3xg3n
0

Share this post


Link to post
Share on other sites

Oh that is awesome.

Thank you very much, I shall be happily tapping away for the next few days!

Regards

0

Share this post


Link to post
Share on other sites

Perhaps a little off-topic but something I quite like is this thing that I added to my .bashrc file:

mkcd () {
mkdir -p "$*"
cd "$*"
}

it creates a command (called mkcd) that allows you to make a directory and cd into it at the same time!!!!!

e.g.,

lappy486:~/sandbox$ mkcd this/is/a/test
lappy486:~/sandbox/this/is/a/test$

I love it.

Edited by rainwater_stillicide
0

Share this post


Link to post
Share on other sites

Hi

I was recently using BASH on my home computer trying to explore / understand the commands. A friend had kindly pointed me to a site with 1000s of commands and explenations of their use. I was also informed that by hitting the 'tab' key twice in the shell, a long list of available commands would reveal itself. To me this was a very exciting moment! Only until I saw the sheer quantity of commands there were...

It asked me "Display all 993 possibilities (y or n)"

993? Yikes!

My question is, for a beginner, what commands would you focus on to improve navigation and exploration? I am trying to sift through the commands but any advice to which are more useful than others, would certainly help!

Thanks for your time.

Look at what's in /bin/

Those are the biggies.

0

Share this post


Link to post
Share on other sites

err.. am new at this.. but what does BASH do?

It's a command shell kinda like DOS.

Edited by tekio
0

Share this post


Link to post
Share on other sites

Hi, only me again.

Using this new information has allowed me to gain valuable insight in to BASH and I thank you again.

Armed with basic navigation skills I went to roothack.org and started the "Sirens" wargame and found the first two levels very frustrating but, at the same time, strangely satisfying. I have now completed the navigation challenges and using the hints on the wargame box I am aware I need to start looking in to different types of shell. So now I am tackling restricted BASH. I did start an earlier post on RBASH but I do not feel I was clear on what I was trying to achieve.

I have read that although restricted BASH does restrict users from performing certain commands, it should not be relied upon as a secure way to protect a box. Could someone help me (and by help I mean nudge me) towards a better understanding of restricted BASH vulnerabilites?

Cheers.

EDIT: I apologise if I should have started this as a new post in the "wargame" section of the forum.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0