cheat sheet for linux and unix
A small Linux cheat sheet, introducing the very basic and very essential commands for surviving at the Linux CLI.
Moving around in the file system
Command
Action
pwd
"Print working directory" - show what dir you're in.
ls
List the contents of a dir.
ls -l
List the contents of a dir and show additional info of the files.
ls -a
List all files, including hidden files.
cd
Change directory.
cd ..
Go to the parent directory.
Examining files
Command
Action
file
Determine the type of a file.
cat
Concatenate a file.
less
View text files and paginate them if needed.
Manipulating files and directories
Command
Action
cp
Copy a file.
cp -i
Copy a file and ask before overwriting.
cp -r
Copy a directory with its contents.
mv
Move or rename a file.
mv -i
Move or rename a file and ask before overwriting.
rm
Remove a file.
rm -r
Remove a directory with its contents.
rm -i
Ask before removing a file. Good to use with the -r option.
mkdir
Make a directory.
rmdir
Remove an empty directory.
rpm command cheat sheet for Linux
rpm is a powerful Package Manager for Red Hat, Suse and Fedora Linux. It can be used to build, install, query, verify, update, and remove/erase individual software packages. A Package consists of an archive of files, and package information, including name, version, and description:
Syntax
Description
Example(s)
rpm -ivh {rpm-file}
Install the package
rpm -ivh mozilla-mail-1.7.5-17.i586.rpm
rpm -ivh --test mozilla-mail-1.7.5-17.i586.rpm
rpm -Uvh {rpm-file}
Upgrade package
rpm -Uvh mozilla-mail-1.7.6-12.i586.rpm
rpm -Uvh --test mozilla-mail-1.7.6-12.i586.rpm
rpm -ev {package}
Erase/remove/ an installed package
rpm -ev mozilla-mail
rpm -ev --nodeps {package}
Erase/remove/ an installed package without checking for dependencies
rpm -ev --nodeps mozilla-mail
rpm -qa
Display list all installed packages
rpm -qa
rpm -qa | less
rpm -qi {package}
Display installed information along with package version and
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
#define M 10 // »º³åÊýÄ¿
int in = 0; // Éú²úÕß·ÅÖòúÆ·µÄλÖÃ
int out = 0; // Ïû·ÑÕßÈ¡²úÆ·µÄλÖÃ
int buff[M] = {0}; // »º³å³õʼ»¯Îª0£¬ ¿ªÊ¼Ê±Ã ......
Linux ÕýÔÚǶÈëʽ¿ª·¢ÁìÓòÎȲ½·¢Õ¹¡£ÒòΪ Linux ʹÓà GPL£¨Çë²ÎÔı¾ÎĺóÃæµÄ²Î¿¼×ÊÁÏ
£©£¬ËùÒÔÈκζԽ« Linux ¶¨ÖÆÓÚ
PDA¡¢ÕÆÉÏ»ú»òÕß¿ÉÅå´øÉ豸¸ÐÐËȤµÄÈ˶¼¿ÉÒÔ´ÓÒòÌØÍøÃâ·ÑÏÂÔØÆäÄں˺ÍÓ¦ÓóÌÐò£¬²¢¿ªÊ¼ÒÆÖ²»ò¿ª·¢¡£Ðí¶à Linux ¸ÄÁ¼Æ·ÖÖÓºÏÁËǶÈëʽ£¯ÊµÊ±Êг¡¡£ËüÃǰüÀ¨
RTLinux£¨ÊµÊ± Linux£©¡¢uclinux£¨ ......
LinuxÄÚºËÌṩÁËlistÕâ¸öÊý¾Ý½á¹¹ÒÔ¼°²Ù×÷º¯Êý¡£Õâ¸öÊý¾Ý½á¹¹ÔÚÄÚºËÇý¶¯ÖÐʹÓù㷺£¬¶øÇÒȷʵ·½±ãʹÓá£ÎªÁËÏêϸÁ˽âÕâ¸öÊý¾Ý½á¹¹µÄÓ÷¨£¬·½±ãÒÔºóʹÓ㬰ÑÕâ¸öÊý¾Ý½á¹¹ÀïÃæµÄ¹¦Äܶ¼ÊÔÓÃÁËÒ»´Î£¬Çå³þÁ˺ܶࡣÏÂÃæÊÇʵÑé³ÌÐòºÍ×Ô¼ºµÃ³öµÄʹÓ÷½·¨£¬Çë¸ßÊÖ¶à¶àÖ¸½Ì¡£ Struct list_head { struct list_head *next, *prev ;}£» ......