Do not use spaces in folder and file names -- Linux does not like that at the command line!
alias Create an alias: alias [-p] [name[=value] ...]
apropos, man -k Search manual for appropriate command
aspell Spell Checker: aspell check myfile.txt
bg Send process to background using jobspec: bg %jobspec
cal Calendar
cat Concatenate and display the content of files: cat [-Ans...] [File]...
cd Change directory: cd [options] [directory]
chgrp Change group ownership: chown [options]... :group file...
chmod Change access permissions
chown Change file owner and group: chown [owner] [:group] file...
clear Clear terminal screen
comm Compare two sorted files
cp Copy: cp [-airuv]... [source] [destination]
cut Divide a file into several parts: cut [-c -d: -f]... [FILE]...
date Display/change date/time: date [option]... [format]
df Display free disk space: df [option]... [file]...
diff Display the differences between two files: diff [-c -i -u] FILES
echo Display message on screen: echo [-e]... [string]...
expand Convert tabs to spaces
exit Exit from program, shell or log out of network: exit
export Set environmental variable
fg Send process to foreground specifying jobspec
file Determine file type: file
find Search for files that meet a desired criteria
free Display memory usage: free [-b|-k|-m|-g|-h]
ftp File Transfer Protocol: ftp myFileServer
grep Search files for specific text: grep [-cEhivlLn...] regex [file...]
hash Remember the full pathname of a name argument: hash [-r] [-p filename] [name]
head Output the first part of files: head [options]... [file]...
help Help for shell builtins
history Command History: history -c
hostname Print or set system name
id Print user and group id's: id [options]... [username]
info Manual in info format: info [command]
jobs List active jobs
join Join lines on a common (sorted) field as in a relational DB
kill Kill a process by specifying PID or %jobspec
killall Kill multiple processes by name
less Display output one screen at a time: less [options]
let Perform arithmetic on shell variables
ln Create a link to a file: ln [-s]...
*a hard link cannot reference a directory or a file outside its own filesystem
locate Find files (updatedb = update locate database)
ls List files: ls [-aFhilrS | -t]... [.. | ~ | /etc]...
man Manual: man [option]... [section] [command]
mkdir Create new directory: mkdir [-p]... [directory]...
more Display output one screen at a time, forward only
mv Move or rename files or directories: mv [iuv]... [source] [destination]
netstat Networking information: netstat -r; netstat -ie ~ ifconfig
passwd Modify a user password
paste Merge lines of files: paste [-d:]... [file]...
ping Test a network connection: ping -c5
printenv Print environment variables
printf Format and print data
ps Process status (gives PID)
pwd Print Working Directory: pwd [option]...
read Read a line from standard input: read -p "Press enter to continue"
rm Remove files: rm [-irfv]... [file]
scp Secure copy (remote file copy)
set View all variables, set shell variables and functions
sftp Secure File Transfer Program
shutdown Shutdown or restart linux
sleep Delay for a specified time
sort Sort text files: sort [options] [file...]
source Run commands from file: source filename [arguments]
ssh Secure Shell client (remote login program)
stat Display file or file system status
su Substitute user identity: su[-l|-p] [user] or su -c 'command'
sudo Execute command as superuser or another user: sudo [command]...
tail Output the last part of files: tail [options]... [file]...
tee Redirect output to multiple files: tee [options]... [file]...
top List processes running on the system
touch Change file timestamps / create file: touch [options]... File...
tr Translilterate, squeeze, delete characters
traceroute tracepath, Trace Route to Host
tree list directories in tree format: tree -aCdL 1
type Identify command type: type [-atp] [name ...]
unalias Remove an alias: unalias [-a] [name ... ]
umask Users file creation mask
uniq Report or filter out repeated lines in a file: uniq [-c -d -i -fn -sn -u]... [InputFile [OutputFile]]
unset Remove variable or function names: unset [-fv] [name]
wc Print byte, word, and line counts: wc [-c|-i|-l|-w]... [file]...
wget Retrieve web pages or files via HTTP, HTTPS or FTP
which Display users path to a command: which [options] [--] program_name [...]
whatis Display brief description of command: whatis [command]...
who List all usernames currently logged in: who [options] [file] [am i]
whoami Display the current user id and name: whoami [options]
xargs Execute command, passing constructed argument list(s): xargs [options] [command]
/bin - binaries essential to boot system and run
/boot
/grub/grub.conf or menu.lst
/RAM disk, boot loader
/vmlinuz (kernel)
/dev - device files for system
(block and charactor type)
/etc - configuration files for system
/passwd, group, rc, group, crontab
/rc.d/rc.sysinit
/bash/bash.rc
/profile
/fstab - devices mounted at boot
/home
/.bash_profile
/.bash_login
/.bashrc
/.profile
/lib - libraries, support for symbolic linking
/lost+found - for filesystem recovery
/media - temporary mount points (newer systems)
/mnt - temporary mount points (older systems)
/root - home directory for root (super user)
/tmp
Mode | File | Directory |
---|---|---|
r | open/read | list contents (x must be set also) |
w | write | create/delete/rename contents (x must be set also) |
x | execute | enter |
vi iMproved - a programmers text editor.
Nano's ANOther editor, an enhanced free Pico clone.
Text editor that is really an IDE
Pico (Pine composer) is a text editor for Unix and Unix-based computer systems
Script must start with the shebang:
Script must be executable:
Script must be on the path:
echo –n “Who is your favorite instructor? “
read INST
if [ “$INST” = “Killham” ]
then
echo “Good choice, you get an A!”
else
echo “ Would you like to rethink your answer?”
for name in Karen Jo Barb Linda Laurie Kim
do
echo “Welcome $name”
done
echo –n “Try to guess my favorite instructor “
read guess
while [ “$guess” != “Schuster” ]; do
echo “No, not that one. Try again. “;
read guess
done
#!/bin/bash
clear
#echo -n "Enter name of file to create: "
#read myString
read -p "Enter name of file to create: " myString
touch $myString
free > $myString
echo >> $myString
df >> $myString
echo >> $myString
echo "Results from ping -c 3 www.unl.edu" >> $myString
ping -c 3 www.unl.edu >> $dateFile
sudo tar -cvpzf [Create Verbose PreservePermissions z=compress Filename] backup.tar.gz --exclude=/mnt /directoryToBeBackedUp
sudo tar -xvpzf [eXtract Verbose PreservePermissions z=uncompress File] backup.tar.gz -C /recoveryDirector [ChangeDirectory]
sudo crontab -e & choose text editor
m h dom m dow comm
Min 0-59
Hour 0-23
DayOfMonth 1-31
Month 1-12
DayOfWeek 0-6 (Sun to Sat)
su = change ID or become Super User
sudo = Super User Do
gksudo = for apps using a GUI
visudo = edits sudoers file
sudo adduser napes
sudo userdel napes
sudo passwd = change password
sudo vi /etc/passwd = etc/passwd contains user names, home directories...
sudo groupadd napesGroup
sudo groupdel napesGroup
sudo adduser napes napesGroup
sudo deluser napes napesGroup
sudo vi /etc/group
chmod 777 example.txt = gives Read, Write & eXecute permissions to user, group and others to file example.txt eg. 111 111 111
sudo apt-get install
ubuntu-restricted-extras
echo $SHELL = Shell you are using
BASH (Bourne-Again SHell) freeware, most common, Brian Fox and Chet Ramey.
CSH (C SHell) The C shell's syntax and usage are very similar to the C programming language.
KSH (Korn SHell) David Korn AT & T Bell Labs.
TCSH enhanced, compatible version of the Berkeley UNIX C shell (CSH).
ps = report a snapshot of the current process
es
pa aux = List all processes in detail running on the system
uname = get name and information about current kernel
version = kernel info
df -h = report file system disk space usage
df -i
du -cksh = size of current folder
du -cksh file.examp = size of file.examp
sudo du -s -h -x /* = estimate file space usage
sudo top (+ h) = "task manager"
ipcs -m = provide info on ipc facilities
inxi -xG =
sleep
kill PID
killall
processName
xkill = starts GUI for killing windows
cd /boot/grub/
vi menu.lst
$ dd bs=512 count=2880 if=/dev/zero of=floppy.img
$ mkfs.msdos floppy.img
$ sudo mount -o loop image.img /media/floppy/
<<<copy your files on to the "drive" now>>>
$ sudo umount /media/floppy/
whois
netstat -print network connections, routing tables, interface...
sudo ifconfig
sudo dhclient = release/renew ip address
sudo vi /etc/resolv.conf
sudo vi/etc/network/interfaces
sudo /bin/hostname (or just hostname)
sudo /bin/hostname name = renames computer to "name"
sudo /etc/init.d/exampleService stop
sudo /etc/init.d/exampleService start
sudo /etc/init.d/exampleService restart
sudo service networking restart
sudo vim /etc/vsftpd.conf
sudo service vsftpd restart
sudo apt-get install wireshark libcap2-bin
sudo groupadd wireshark
sudo adduser napes wireshark
sudo chgrp wireshark /usr/bin/dumpcap
sudo chmod 755 /usr/bin/dumpcap
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
sudo apt-get install gufw
turn on
add rules (show extended options) + :
select number 0, deny, service, SSH
or
sudo ufw
status verbose
sudo ufw allow/deny x.x.x.x
sudo ufw allow/deny [port#]
sudo mateconf-editor apps\caja\preferences\media_automount (uncheck),
sudo vi /etc/default/grub
Add this line
GRUB_GFXPAYLOAD_LINUX=text
sudo update-grub
sudo reboot
Separate partition for /boot seems to for LVM and/or "full" disk encryption on the rest of the drive.
The likely cause of this issue is too many previous kernels installed. The /boot directory contains all of the kernel images. The separate partition for /boot is only around 227MB in size. This partition is full. Ubuntu issues kernel updates which bump the version number in the package name fairly frequently even for long term stable versions, so over time if you keep the system up to date, the /boot directory will grow.
Find the currently running kernel with:
uname -r
List all installed kernels with:
aptitude search ~ilinux-image
This may also return some packages that aren't kernels. There is usually no need for more than two kernels to be installed - the kernel in use and, as a fallback, its predecessor.
Remove older kernels, one by one, like this:
sudo apt-get autoremove linux-image-3.2.0-23-generic
Substitute "3.2.0-23-generic" with the actual kernel version you want to remove! Don't remove packages such as linux-image-generic! Do not to remove the currently running kernel!
sudo apt-get install nvidia-current-updates
Voici la liste des commandes disponibles pour le kernel (dans le terminal):
cd
chroot - change root directory?
copy
cp
echo
getfold
hostname
hwclock - query or set the hardware clock (RTC)
logname
ls
mcd
mdel
mkdir
mmd
mrd
netstat
rm
rmdir
rusers
sleep
uname
version
who