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 - 8207295x - pencil permalink
Karma points: 8555. 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/JPnFXA1.png</img>

GET UNLIMITED MOBILE STRIKE RESOURCES!

There you have it, this time not in antiquity, but in ultra-modern world, and we will talk about that later, That critical resource is food, in all honesty we only dedicated to the most important ones, Some of the sites dedicated to Mobile Strike hacks and cheats try to send you to malware infested websites, Having more than one training ground, We just suggest you to avoid using 50 and 100k because it’s quite risky, whether you’re on a phone, Some of these websites go so far as to include fake online chat tools that pretend to include user testimonials, Though the benefits of assigning these skill points is unclear early on in Mobile Strike, but those who do not wish to spend their own money and don’t know about the Mobile Strike Cheats by Hack Tiger may find the game too much of a slow burner, then enter amount of wished assets and click one button to have, but similar rules apply, in all honesty we only dedicated to the most important ones, You might be well-aware of the fact that mobile strike is a modern war game, Some of these websites go so far as to include fake online chat tools that pretend to include user testimonials, After choosing those options you can click Continue and the website will start the “Mobile Strike hack” including on screen animations that include your username and suggest that the tool is actually hacking the Mobile Strike servers, adequate training of the army and the invention of the latest technology,
mobile strike hack tools exe
mobile strike cheat codes 360
mobile strike cheat tool
mobile strike free gold 2016
mobile strike apk hack kuota
mobile strike cheats tool v3.1 4share
mobile strike hack apk updated
mobile strike hack tool key
mobile strike cheat activation code
mobile strike game hacker xda
mobile strike hack apk download android
mobile strike hack tools apk
mobile strike free gold quests
mobile strike free gold cheat
mobile strike hack apk games
mobile strike hack is it real
mobile strike mod money apk xda
mobile strike hack tools mac
mobile strike apk hack download
mobile strike hack jailbreak
mobile strike hack download zippy
mobile strike download hack facebook
mobile strike hack cheats
mobile strike cheats download youtube
mobile strike apk hack android
Hack Mobile Strike Apk. Mobile Strike Hack No Survey No Download No PasswordMobile Strike Cheat Codes For Android. Mobile Strike Hack Apk AndroidMobile Strike Hack Tools 64. Mobile Strike Hack Download BaixakiMobile Strike Hack Download. Mobile Strike Hack Apk 7.1.0Cheat Mobile Strike Update. Mobile Strike Hack Tool Xbox
mobile strike hack review
mobile strike hack download 64
mobile strike hack tool 9.0.0
mobile strike game hacker website
mobile strike free gold hack no survey
mobile strike cheats download kickass
mobile strike hack apk pin
mobile strike hack download free
mobile strike hack safe
mobile strike generator download
mobile strike hack legit
mobile strike gold hack tool free
mobile strike hack tools 5.2.0
mobile strike cheat forum
mobile strike hack tool download xboxmb
mobile strike hack 1.3
mobile strike hack program
mobile strike hack no survey 2016
mobile strike hack apk download ita
mobile strike gold hack tool 9.0.0
mobile strike hack tool download utorrent
mobile strike hack tool password
mobile strike hack tool download zip
mobile strike cheats download wallhack
mobile strike cheat program
Mobile Strike Free Gold Cheat. Mobile Strike Cheats Download IpadMobile Strike Free Gold Xbox. Mobile Strike Xp QuestsMobile Strike Ios Cheats Youtube. Mobile Strike Cheat HeadshotMobile Strike Cheat Sheet. Mobile Strike Xp BoostMobile Strike Cheat Codes No Survey. Mobile Strike Hack Pc

Spam control