LINUX System Call Quick Reference
Jialong He
Jialong_he@bigfoot.
com
http://www.
bigfoot.
com/~jialong_he
Introduction
System call is the services provided by Linux kernel.
In C programming, it often uses functions defined inlibc
which provides a wrapper for many system calls.
Manual page section 2 provides more...
Plus
LINUX System Call Quick Reference Jialong He Jialong_he@bigfoot. com http://www. bigfoot. com/~jialong_he Introduction System call is the services provided by Linux kernel. In C programming, it often uses functions defined inlibc which provides a wrapper for many system calls. Manual page section 2 provides more information about system calls. To get an overview, use “man 2 intro” in a command shell. It is also possible to invokesyscall() function directly. Each system call has a function number defined in <syscall. h>or <unistd. h>. Internally, system call is invokded by software interrupt 0x80 to transfer control to the kernel. System call table is defined in Linux kernel source file “arch/i386/kernel/entry. S ”. System Call Example #include <syscall. h> #include <unistd. h> #include <stdio. h> #include <sys/types. h> int main(void) { long ID1, ID2; /*-----------------------------*/ /* direct system call */ /* SYS_getpid (func no. is 20
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 3
Lectures: 9
Téléchargements: 0
The FSF’s gcc C compiler is the single
most important programming tool for
Linux, since it is required for building
the system and all the other tools.
Other key tools include make, source
code control tools like CVS and RCS,
and editors like vi and Emacs.
There
are many variations of vi, including
vim, nvi, elvis, and...
Plus
The FSF’s gcc C compiler is the single most important programming tool for Linux, since it is required for building the system and all the other tools. Other key tools include make, source code control tools like CVS and RCS, and editors like vi and Emacs. There are many variations of vi, including vim, nvi, elvis, and vile. Along with the C compiler, all systems need and rely on various libraries, including glibc and libstdc++. Useful Books: Programming with GNU Software Mike Loukides, Andy Oram Learning the vi Editor Linda Lamb, Arnold Robbins CVS Pocket Reference Gregor N. Purdy Learning GNU Emacs Debra Cameron, Bill Rosenblatt, Eric S. Raymond GNU Emacs Manual Richard M. Stallman (FSF) Managing Projects with make Andrew Oram, Steve Talbott Debugging with GDB: The GNU Source-Level Debugger Richard M. Stallman, Cygnus Solutions (FSF) Linux includes a full complement of Unix command-line tools, courtesy of the Free Software Foundation’s
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 1
Lectures: 36
Téléchargements: 0
THE ONE PAGE LINUX MANUAL
A summary of useful Linux commands
Version 3.
0 May 1999 squadron@powerup.
com.
au
Starting & Stopping
shutdown -h now Shutdown the system now and do not
reboot
halt Stop all processes - same as above
shutdown -r 5 Shutdown the system in 5 minutes and
reboot
shutdown -r now Shutdown the system now...
Plus
THE ONE PAGE LINUX MANUAL A summary of useful Linux commands Version 3. 0 May 1999 squadron@powerup. com. au Starting & Stopping shutdown -h now Shutdown the system now and do not reboot halt Stop all processes - same as above shutdown -r 5 Shutdown the system in 5 minutes and reboot shutdown -r now Shutdown the system now and reboot reboot Stop all processes and then reboot - same as above startx Start the X system Accessing & mounting file systems mount -t iso9660 /dev/cdrom /mnt/cdrom Mount the device cdrom and call it cdrom under the /mnt directory mount -t msdos /dev/hdd /mnt/ddrive Mount hard disk “d” as a msdos file system and call it ddrive under the /mnt directory mount -t vfat /dev/hda1 /mnt/cdrive Mount hard disk “a” as a VFAT file system and call it cdrive under the /mnt directory umount /mnt/cdrom Unmount the cdrom Finding files and text within files find / -name fname Starting with the root directory, look for the file called fname fi
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 2
Lectures: 24
Téléchargements: 0
Unix/Linux Command Reference .
com
File Commands
ls – directory listing
ls -al – formatted listing with hidden files
cd dir - change directory to dir
cd – change to home
pwd – show current directory
mkdir dir – create a directory dir
rm file – delete file
rm -r dir – delete directory dir
rm -f file – force...
Plus
Unix/Linux Command Reference . com File Commands ls – directory listing ls -al – formatted listing with hidden files cd dir - change directory to dir cd – change to home pwd – show current directory mkdir dir – create a directory dir rm file – delete file rm -r dir – delete directory dir rm -f file – force remove file rm -rf dir – force remove directory dir * cp file1 file2 – copy file1 to file2 cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it doesn t exist mv file1 file2 – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2 ln -s file link – create symbolic link link to file touch file – create or update file cat > file – places standard input into file more file – output the contents of file head file – output the first 10 lines of file tail file – output the last 10 lines of file tail -f file – output the contents of file as it grows, starting with the last 10 lines Process Management ps – display your c
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 1
Lectures: 5
Téléchargements: 0
Ubuntu Reference
Privileges
sudo command – run command as root
sudo -s – open a root shell
sudo -s -u user – open a shell as user
sudo -k – forget sudo passwords
gksudo command – visual sudo dialog (GNOME)
kdesudo command – visual sudo dialog (KDE)
sudo visudo – edit /etc/sudoers
gksudo nautilus – root file...
Plus
Ubuntu Reference Privileges sudo command – run command as root sudo -s – open a root shell sudo -s -u user – open a shell as user sudo -k – forget sudo passwords gksudo command – visual sudo dialog (GNOME) kdesudo command – visual sudo dialog (KDE) sudo visudo – edit /etc/sudoers gksudo nautilus – root file manager (GNOME) kdesudo konqueror – root file manager (KDE) passwd – change your password Display sudo /etc/init. d/gdm restart – restart X and return to login (GNOME) sudo /etc/init. d/kdm restart – restart X and return to login (KDE) (file) /etc/X11/xorg. conf – display configuration sudo dexconf – reset xorg. conf configuration Ctrl+Alt+Bksp – restart X display if frozen Ctrl+Alt+FN – switch to tty N Ctrl+Alt+F7 – switch back to X display System Services¹ start service – start job service (Upstart) stop service – stop job service (Upstart) status service – check if service is running (Upstart) /etc/init. d/service start – start service (SysV) /e
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 1
Lectures: 2
Téléchargements: 0
LINUX Admin Quick Reference
Jialong He
Jialong_he@bigfoot.
com
http://www.
bigfoot.
com/~jialong_he
User Management
Files
/etc/group
/etc/passwd
/etc/shadow
User account information.
/etc/bashrc
/etc/profile
$HOME/.
bashrc
$HOME/.
bash_profile
bash system wide and per user init files.
/etc/csh.
cshrc
/etc/csh....
Plus
LINUX Admin Quick Reference Jialong He Jialong_he@bigfoot. com http://www. bigfoot. com/~jialong_he User Management Files /etc/group /etc/passwd /etc/shadow User account information. /etc/bashrc /etc/profile $HOME/. bashrc $HOME/. bash_profile bash system wide and per user init files. /etc/csh. cshrc /etc/csh. login $HOME/. cshrc $HOME/. tcshrc $HOME/. login tcsh system wide and per user init files. /etc/skel template files for new users. /etc/default default for certain commands. /etc/redhat-release /etc/slackware-version Redhat/Slackware version info (Linux kernel version with “uname –a”) Commands adduser script to create an new user interactively (slackware) or link to useradd (Redhat). useradd, userdel, usermod create, delete, modify an new user or update default new user information. . newusers update and create new users (batch mode). groupadd, groupdel, groupmod add, delete or modify group. chage. ch fn, chsh
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 5
Lectures: 29
Téléchargements: 0
Using Linux the CLI way - Cheat Sheet
Pg.
1
1.
Basic Operations
Linux, like any other Unix system is case sensitive so
type them exactly as they are written in this article.
The File Separator
An important feature that differentiates Unix systems
from Windows systems is the way one refers to the File
Separator.
On UNIX...
Plus
Using Linux the CLI way - Cheat Sheet Pg. 1 1. Basic Operations Linux, like any other Unix system is case sensitive so type them exactly as they are written in this article. The File Separator An important feature that differentiates Unix systems from Windows systems is the way one refers to the File Separator. On UNIX based systems it’s as follows. /usr/local/apache/httpd. conf -----> the forward file separator. While on Windows systems. C:\webserver\apache\httpd. conf -----> the backward file separator. any_command --help | more Display a brief help file on a command (works with most commands). –help works similar to DOS /h switch. The more pipe is needed if the output is longer than one screen. | This isn’t an L, it is what we call the redirection operator. If you are trying to find it on your keyboard, you’ll probably see it on the top row with the numerical keys. The main purpose of the redirector is to redirect output from one p
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 6
Lectures: 6
Téléchargements: 0
Monitoring the permissions on system files is crucial to maintain host integrity.
• Regularly audit your systems for any unauthorized and unnecessary use of the setuid or setgid
permissions.
“Set-user-ID root” programs run as the root user, regardless of who is executing them,
and are a frequent cause of buffer overflows....
Plus
Monitoring the permissions on system files is crucial to maintain host integrity. • Regularly audit your systems for any unauthorized and unnecessary use of the setuid or setgid permissions. “Set-user-ID root” programs run as the root user, regardless of who is executing them, and are a frequent cause of buffer overflows. Many programs are setuid and setgid to enable a normal user to perform operations that would otherwise require root, and can be removed if your users do not need such permission. Find all setuid and setgid programs on your host and descriminately remove the setuid or setgid permissions on a suspicious program with chmod: root# find / -type f -perm +6000 -ls 59520 30 -rwsr-xr-x 1 root root 30560 Apr 15 1999 /usr/bin/chage 59560 16 -r-sr-sr-x 1 root lp 15816 Jan 6 2000 /usr/bin/lpq root# chmod -s /usr/bin/chage /usr/bin/lpq root# ls -l /usr/bin/lpq /usr/bin/chage -rwxr-xr-x 1 root root 30560 Apr 15 1999 /usr/bin/chage -r-xr-xr-x 1 root lp 15816 Jan
Moins
Par chatainsim
Document Adobe PDF
Publiée le 14 Juil. 2010
Pages: 2
Lectures: 3
Téléchargements: 0
Le petit guide de la conversion numérique
Le petit guide de la conversion numérique est un document évolutif qui propose de convertir une vidéo dans un
format différent.
En effet il se peut qu à un instant t vous ayez une vidéo dans un certain format mais le support
vers lequel vous le destinez n est pas compatible avec...
Plus
Le petit guide de la conversion numérique Le petit guide de la conversion numérique est un document évolutif qui propose de convertir une vidéo dans un format différent. En effet il se peut qu à un instant t vous ayez une vidéo dans un certain format mais le support vers lequel vous le destinez n est pas compatible avec votre format actuel, ou encore, vous destinez votre vidéo au web et il est nécessaire de diminuer le débit et la résolution. La liste proposée ci-dessous sera complétée au fur et à mesure des cas de figure que je suis amené à rencontrer, n hésitez pas à me contacter pour des compléments ou des cas d école. Aucune explication ne sera donnée sur l installation des logiciels utilisés, seule l utilisation est ici décrite. On notera enfin que les méthodes sont souvent graphiques et que si elles ne sont pas nécessairement les plus rapides, elles ont le mérite de fonctionner et de voir fonctionner un nombre important de logiciels pour se les approprier par la
Moins
Par chatainsim
Document Adobe PDF
Publiée le 13 Juil. 2010
Pages: 13
Lectures: 49
Téléchargements: 0