Refreshing Drink of Ideas

Linux / Unix Notes

This article is a list of notes I've collected to help me with Linux and/or Unix.  Please don't consider this a comprehensive reference.  I'm not a Linux or Unix expert.  These notes are just some things I've had to remember but always seem to forget when I've had to log onto a Linux or Unix machine for the following:
  • Setting up a website.  I think Linux is the easiest platform and has the most tools, free and open, readily available.
  • Attempting to develop an application for my Android phone (which uses a form a Unix) and experimenting with root access with a command prompt.
  • Hacking my older Directv Tivo DVR
I've never tried or even had much interest in using Linux and X11 windows as an alternative to MS Windows for my desktop.  So there won't be any notes about that in this article.

There are certainly more comprehensive and accessible Linux/Unix references out there on other websites.  However, because there were some things I couldn't find quickly enough or expressed simply enough or whatever, I found I needed to write my own notes.  These notes are now here where I can find them no matter where I am.  They are also for anybody else, due to being in the same situation for frame of mind as me, has Googled here for the quickest answer.

Wherever I list a shell command, the shell will most likely be Bash with a prompt of "$".   The commands can be used interactively from a terminal or from within a shell script.  Here are the notes below.


Display which shell processor is being used to interpret your commands at the command line:
$ echo $0
The above will echo out the name of the shell.  For example the output may be:
-bash
Alternatively to get the full path to the shell processor, do the following:
$ echo $SHELL

Listing the contents of a directory

$ ls
List each item with full attributes
$ ls -l

To list even files that begin with "." because these are normally hidden
$ ls -l -a

To list files that begin with "." but excluding the implied directory names of "." (current) or ".." (parent)

$ ls -l -A

A file name or directory name, with or without wildcards ('*" or "?"), may be be provided to get directory limited to files or directories that match. 

$ ls -l -A <filename>

If shell is set up for it (Bash usually is), then the easier to remember "dir" command can be used

$ dir -l -A

For quick help on any command, try including "--help" option:

$ dir --help

For extensive help (when available) use the "man" command:
$ man set
The above command will list out a manual article on the "set" command


Displaying the current directory (or working directory):
$ pwd

Changing the current directory - for example, to a directory called "public_html" under the current:
$ cd  public_html
A wildcard will make this quicker and easier to type if "public_html" is the only directory that begins with "pub"
$ cd pub*

To make a new subdirectory:
$mkdir <directory name>

The Bash shell can show the host name and current directory in each prompt.  This is the default on many Linux systems.  Set variable PS1 as follows:
$ PS1="\u@\h:\w\$"
Variable PS1 defines the prompt string for Bash.  With special escape character "\" commands cause system values to be inserted.  A good explanation for this was found at on the web here.


Changing the terminal type that system expects you to have
Just set the TERM variable
$ TERM=vt100

Listing all variables with their values
$ set

Exporting variables to sub-processes:
The first command will cause all subsequently created or modified variables to be exported
$ set -a
The next command will specify a list of names to export
$ export <names>

Start a background process
In the below example, the "&" indicates that the given command has a requirement for terminal access
$ <command> &

List running processes
The following will list all processes user is allowed to view based on authorization level
$ ps -e
A root user would be able to see all processes running on the system with the above.  A non-privileged user would only be able to see his own.

Use --help to see more options.


Execute a command as another user

This is may be allowed only if a privileged user.  Also may prompt for password. 

su -c "<command>" <userid>

Sending the output of one command to be processed by another, use the pipe character "|".   The standard output of 1st (normally printed on terminal display) of will be sent as the standard input (normally from terminal keyboard) to the 2nd.

Example using grep processor to list out any running process that contains a certain string ("bash") in its name

$ ps -e | grep "bash"

To control flow of output to the screen
Pipe output to "more" processor
$ set | more
The above list all variables ("set") by sending one page of output to the terminal at a time.  Key "q" or cntrl-c to stop.  Any other key will go to next page.

A better processor to use is "less"
$ set  | less
The above will list all variables by 1st sending 1st page of output to the terminal.  The "q"  key will stop.  Keyboard up and down arrow keys will allow navigating up and down one line at a time.  Space key will move a page at a time.  Other keys may do other things so look this up in "man" or use
$ less --help

Forthstar - clock 23:55:27 - Saturday, 24.04.10 - Linux / Unix - 4431735x - pencil permalink
Karma points: 5246. Do you like this article? [yes/no]

RSS 2.0 feed, Trackback, print preview, email this article

  • RSS 2.0 feed of this article, including comments:  RSS 2.0 comments feed
  • Use this Trackback URL for ping (right mouse click and copy URL).
  • You can [print] this article, [email] it, or export a [PDF].

Local search Linux Unix Notes

No results found or search not configured.

Google search

No results found or search not configured.

Add new comment:

Comments must be approved before being published. Thank you!

Preview and Confirm Your Comment!

<img>http://i.imgur.com/JxGdGX0.png</img>

JUST GRAB FIFA 16 RESOURCES!

Ibra or Messi. because there are no limit in using this great program. The device supplied to you this is actually the simplest variant where all you must do is simply supply your log-in info on the basis of the system that is games console which you employ. wie man dort cheaten kann. Actually it was not that hard to develop. Our FIFA 16 Coin Generator is designed and tested by professional programmers and you can use it on different platforms such as Xbox 360. Only a few are so lucky to get IF player or incredible player like Cristiano Ronaldo. Developers used latest programming and decoding techniques to make this software safe. If you face trouble at any time you can check our FAQ or directly send our support a message. because the engine and source code of the Ultimate Team WebApp is not that different from FUT 15. 000 signatures in its first 24 hours. This helps to ensure your online devices remain secure as we are already linked to the game servers. Other features include two-year loans. Not only that but you can use the tool unlimited number of times when you finish the verification. PlayStation 4. Usted no tiene que pagar nada y. Zelfs dan is het allemaal over geluk wat speler ze krijgen. Simply access the FIFA 16 Coin Generator page on your browser or smartphone. Waarom geld uitgeven als het niet eens zeker als je geweldige speler krijgt? De Ultimate Team Hack is helemaal gratis en met de Gratis FIFA 16 Munten op uw account kunt u gemakkelijk kopen een speler je wilt en regel het hele spel. Please leave your personal review on our tool! We are always looking forward to improve our Hack in order to bring you more fun! Don’t forget to share and like this website on Facebook.
fifa 16 coins reddit
fifa 16 hacks and cheats
hack fifa 16 youtube
fifa 16 hack generator
fifa 16 generator no offer
fifa 16 2200 points xbox one einlösen
fifa 16 money cheat 0.3z
fifa 16 coins tool
fifa 16 coins on xbox one
fifa 16 ultimate team coins hack online no survey
fifa 16 cheats codes
fifa 16 coins 4 mom
fifa 16 coins easy
fifa 16 android hack v.2.3
fifa 16 coins tax
fifa 16 coins cheat code
fifa 16 hack mobile
fifa 16 money cheat codes ps4
fifa 16 cheats codes ps4
fifa 16 unlimited coins apk
fifa 16 ultimate team coins free ps4
hack fifa 16 coins xbox 360
fifa 16 cheats download
fifa 16 ultimate team coins ps4 free
fifa 16 coins ps4 canada
Fifa 16 Free Coins Thai. Fifa 16 Hack MoneyFifa 16 Hack Coins Xbox. Fifa 16 Ultimate Team Coins CheapFifa 16 Coins Ps4 Ebay. Hack Fifa 16 Ios CoinsFifa 16 Ios Coins Generator. Fifa 16 Hack Tool ApkFifa 16 Android Hack Online. Fifa 16 Hack For Ps4
hack fifa 16 android root
fifa 16 coins ps3
fifa 16 buy coins ban
fifa 16 coins 10k
fifa 16 free coins glitch ps4
fifa 16 android coins sms
fifa 16 cheats and tricks
fifa 16 coins for ps4
fifa 16 coins pc 14
fifa 16 free coins for xbox 360
fifa 16 ultimate team coins hack xbox 360
fifa 16 coins xtmmo
fifa 16 free coins generator
fifa 16 coins rules
fifa 16 hack no survey ios
fifa 16 free coins no human verification no survey
fifa 16 generator coins xbox
fifa 16 coins ps4 us
fifa 16 coins buy pc
fifa 16 money cheat codes ps4
fifa 16 xbox 360 coins xbox
fifa 16 coins debit card
fifa 16 hacks for ps4
hack fifa 16 release
fifa 16 android coins buy
Fifa 16 Hack Coins Online. Fifa 16 Coins IndonesiaFifa 16 Ultimate Team Coins Ps4 Hack. Fifa 16 Cheats Career ModeFifa 16 Free Coins No Verification. Fifa 16 Hack Tool No Human VerificationFifa 16 Coins FreeFifa 16 Hacks No Verification. Fifa 16 Buy Coins Euro

Spam control