Skip to content

Instantly share code, notes, and snippets.

@mohitesachin217
Last active June 19, 2016 09:14
Show Gist options
  • Save mohitesachin217/dd8b005c5037947afb175aec93c0f045 to your computer and use it in GitHub Desktop.
Save mohitesachin217/dd8b005c5037947afb175aec93c0f045 to your computer and use it in GitHub Desktop.
working with commandline
--- bash
enter the command
cat /etc/passwd
and you will see the list of all the user names and bash assigned to the user
Ex.kia:x:2000:2000:kia,,,:/home/kia:/bin/bash
each bash has it's configuration as well as global configuration
global configuration file is stored in
/etc/profile -- profile is the file which stores global configuration for bash
user home directory contains lots of hidden files all the hidden files starts with . ex. .bashrc
.bashrc file contanis alias with is get called when bash starts
linux only looks for the executable files in the path only now in current directory
here
la -a
. -- single dot means current directory
.. -- parent directory
to make linux to find the executable you need to add path to the path environment variable
type env in command line and you wil see whole list of environment variable
you can see the path there
you can add the path in path env by
PATH = $PATH:[your new path to add]
and now linux will find the files you wnat in your path
you can create variable with
VARIABLE=VALUE;
AND export thsi variable to env by useing
export VARIABLE
and echo the variable with
echo $VARIABLE
uname command with return what operating system you are using
uname -a will give all the information about your currently running system
man is used to get help (manuel)
man history will give you manual page for history command
man -k [file] will search all the man pages for that specific [file] string
exec command executes the command and exit the shell
if you use the exec ls command then teminal will show the ls and will exit because of exec command that is why most of the time this command is used to end the bash file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment