Rejoining class chat
Most of you probably already know this but I thought I would throw it on here for quick reference.
So to join a class chat session do:
$screen irssi
/server irc
/join nameOfYourCouse
Using vi/vim
This is not classic vi it's vim.
The esc key will get you back to command mode.
vi - is a moded text editor
i this will put you into input mode. (This will place characters before the courser.
a this will insert after the courser.
I this will insert at the beginning of the line
A this will insert at the end of a the line.
o this will start on the next line.
O this will start you on the line before.
Navigation
h go left
l go right
j down
k up
w right by word
b left by word
{} these jump up and down by stanza
Manipulation
X remove character left (cut)
x remove character right (cut)
p place to the left of cursor (paste)
P place to the right of cursor (paste)
. this will run the last command
How to save from vi - in command mode hit : then w then fileName (:w myFile)
How to leave the vi text editor
:wq - save and quit
:w - name save as
:q - quit
:q! - with without saving
Viewing files in a directory with Wildcards
ls -a - This will list hidden files. If you use the -A this will remove the extra information.
ls -1 - This will list the files that a normal ls would give you but it will list them with one file per line.
ls -1 ???? - This will list only the files in your current directory that have 4 characters. Similarly if you use 5 ?s it would list the files with 5 characters.
ls | wc -l - The wc -l part of the command counts the entries.
ls -1 c??? - This will give all the 4 character files that begin with c. If you wanted to see the ones with uppercase C as well you can use a character class like : [cC]???
ls -1 ?[aeiou]?[aeiou]? - This command looks very complicated but it is simply giving us the 5 character file names which have vowels in the 2nd and 4th character place.
ls -1 ????* - This shows the files which have 4 or more characters.
ls -1 *p - This will show all the files that begin with “p”
ls -1 *hi* - This searches for any and all files that have the characters “hi” in them.
file * - This command will show the file information for every in the current directory.
Wildcards
* - match 0 or more of anything.
? - match exactly 1 of anything.
[] - Character class match any 1 of the enclosed
[^ ] - inverted characters class, do not match any 1 of enclosed.
If it accepts a file you can use a wild card in its place.
Some basic scripting stuff and cool commands…
* If you would like to use a command but need to have a “-something” the “-” would make the command try and use “something” as an argument. So if you need to have a “-” in something you need in a command you can use – to negate the later “-”. An example of this: grep -q – '-greppingForThis'
$ cat <<name
>stuff here.
>More things.
>name
$ cat <<< "Stuff"
Stuff
...
550 echo "hello"
551 echo "$test"
$ !550
hello