文章目录
一、系统启动一般流程1.1 Windows1.2 Linux1.2.1 Linux简单驱动程序框架二、S3C2440内部资源三、命令入门3.1 终端Teminal3.2 Linux命令提示符3.3 Linux命令的格式3.4 常见命令含义3.5 rm -rf /*的含义3.6 相对/绝对路径四、附录:常见Linux命令英文全称一、系统启动一般流程
1.1 Windows
1.2 Linux
1.2.1 Linux简单驱动程序框架
GPIO举例二、S3C2440内部资源
内核:ARM920T16/32位RICS体系结构三、命令入门
3.1 终端Teminal
Ctrl+Alt+T
启动
查看环境变量路径
echo $PATH
设置PATH环境变量添加我们自己的目录:
exprot PATH=$PATH:/my/dir
文件设置可执行权限:
chomd +x 文件名
3.2 Linux命令提示符
~
表示家目录$
表示普通用户#
表示root管理员3.3 Linux命令的格式
命令 [选项] [参数]eg:
ls
ls -l
ls -l /home
3.4 常见命令含义
pwd
打印当前所在路径(print working directory
)cd
切换路径(change directory
) cd ~ 切换至当前用户的家目录cd . 切换至当前路径cd … 切换至上一级路径cd …/… 切换至上上级路径cd - 切换至上一次路径ls
列出目录内容(list
) -l(long的缩写)显示目录下详细的信息(文件权限、最后修改时间、文件大小)-a(all的缩写)显示了隐藏文件(以.为开头为隐藏文件)-h(human-able的缩写)将文件大小以K(KB)、M(MB)、G(GB)来表示mkdir
创建目录(make directory
) mkdir dir0 创建dir0这个目录mkdir -p 父目录/子目录rmdir
删除目录(remove directory
)不能删除非空目录rm -r 即可删除非空目录(-r为递归删除的含义:意思是删除当前目录下所有文件和文件夹)mv
重命名/移动(move
)mv 旧文件名 新文件名(修改文件名)mv 旧目录名 新目录名(修改目录名)mv 文件名 目录名(移动路径)touch
新建文件cp
复制(copy
) cp -r dir1 dir2 复制dir1目录下所有内容至dir2(-r参数为递归复制)rm
删除文件(remove
) rm -i file 删除文件file前,要求你是否同意删除(y表示同意,n表示取消)rm -r dir 删除整个dir目录rm -ir dir 删除目录dir前,要求你是否同意删除其中的每一个文件(每次都会询问)cat
查看(catenate
) cat -n file 以显示行号的方式输出clear
刷新屏幕(保留历史命令记录)reset
重新初始化屏幕(清除历史命令记录)
man
手册、帮助(manual
)man man 查看man命令含义man 2 open 查看open库函数含义 1 可执行程序或 shell 命令
2 系统调用(内核提供的函数)
3 库调用(程序库中的函数)
4 特殊文件(通常位于 /dev)
5 文件格式和规范,如 /etc/passwd
6 游戏
7 杂项(包括宏包和规范,如 man(7),groff(7))
8 系统管理命令(通常只针对 root 用户)
9 内核例程wc
统计(word count
)统计(行数、字数、大小)ps
进程状态查看(processes status )ps -auxkill
关闭进程(kill后接 进程PID号)uname
查看系统名称(unix name)
3.5 rm -rf /*的含义
rm -rf /*
Linux的目录是使用 / 之类的目录形式存放,rm 是Linux的删除命令,后面带的“-rf”,"-r"指的是 递归删除(意思是删除当前目录下所有文件和文件夹),而“-f”指的是 强制删除 。后方的/*指的是 根目录“/”下的所有文件。即删除根目录下所有内容。
3.6 相对/绝对路径
/home/pi 是绝对路径相对路径一般以.或…构成 当前路径为/bin,./pwd就是直接执行pwd程序当前路径为/home/pi/Picture,输入cd …/Music 切换至/home/pi/Music四、附录:常见Linux命令英文全称
linux 命令英文全称
su:Swith user 切换用户,切换到root用户cat: Concatenate 串联uname: Unix name 系统名称df: Disk free 空余硬盘du: Disk usage 硬盘使用率chown: Change owner 改变所有者chgrp: Change group 改变用户组ps:Process Status 进程状态tar:Tape archive 解压文件chmod: Change mode 改变模式umount: Unmount 卸载ldd:List dynamic dependencies 列出动态相依insmod:Install module 安装模块rmmod:Remove module 删除模块lsmod:List module 列表模块alias :Create your own name for a commandbash :GNU Bourne-Again Shell linux内核 grep:global regular expression printhttpd :Start Apacheipcalc :Calculate IP information for a hostping :Send ICMP ECHO_Request to network hostsreboot: Restart your computersudo:Superuser do/bin = BINaries /dev = DEVices /etc = ETCetera /lib = LIBrary /proc = PROCesses /sbin = Superuser BINaries /tmp = TeMPorary /usr = Unix Shared Resources /var = VARiable ? FIFO = First In, First Out GRUB = GRand Unified Bootloader IFS = Internal Field Seperators LILO = LInux LOader MySQL = My最初作者的名字SQL = Structured Query Language PHP = Personal Home Page Tools = PHP Hypertext Preprocessor PS = Prompt String Perl = "Pratical Extraction and Report Language" = "Pathologically Eclectic Rubbish Lister" Python Monty Python's Flying Circus Tcl = Tool Command Language Tk = ToolKit VT = Video Terminal YaST = Yet Another Setup Tool apache = "a patchy" server apt = Advanced Packaging Tool ar = archiver as = assembler bash = Bourne Again SHell bc = Basic (Better) Calculator bg = BackGround cal = CALendar cat = CATenate cd = Change Directory chgrp = CHange GRouP chmod = CHange MODe chown = CHange OWNer chsh = CHange SHell cmp = compare cobra = Common Object Request Broker Architecture comm = common cp = CoPy cpio = CoPy In and Out cpp = C Pre Processor cups = Common Unix Printing System cvs = Current Version System daemon = Disk And Execution MONitor dc = Desk Calculator dd = Disk Dump df = Disk Free diff = DIFFerence dmesg = diagnostic message du = Disk Usage ed = editor egrep = Extended GREP elf = Extensible Linking Format elm = ELectronic Mail emacs = Editor MACroS eval = EVALuate ex = EXtended exec = EXECute fd = file descriptors fg = ForeGround fgrep = Fixed GREP fmt = format fsck = File System ChecK fstab = FileSystem TABle fvwm = F*** Virtual Window Manager gawk = GNU AWK gpg = GNU Privacy Guard groff = GNU troff hal = Hardware Abstraction Layer joe = Joe's Own Editor ksh = Korn SHell lame = Lame Ain't an MP3 Encoder lex = LEXical analyser lisp = LISt Processing = Lots of Irritating Superfluous Parentheses ln = LiNk lpr = Line PRint ls = list lsof = LiSt Open Files m4 = Macro processor Version 4 man = MANual pages mawk = Mike Brennan's AWK mc = Midnight Commander mkfs = MaKe FileSystem mknod = MaKe NODe motd = Message of The Day mozilla = MOsaic GodZILLa mtab = Mount TABle mv = MoVe nano = Nano's ANOther editor nawk = New AWK nl = Number of Lines nm = names nohup = No HangUP nroff = New ROFF od = Octal Dump passwd = PASSWorD pg = pager pico = PIne's message COmposition editor pine = "Program for Internet News & Email" = "Pine is not Elm" ping = Packet InterNet Grouper pirntcap = PRINTer CAPability popd = POP Directory pr = pre printf = PRINT Formatted ps = Processes Status pty = pseudo tty pushd = PUSH Directory pwd = Print Working Directory rc = runcom = run command, shell rev = REVerse rm = ReMove rn = Read News roff = RunOFF rpm = RPM Package Manager = RedHat Package Manager rsh, rlogin, = Remote rxvt = ouR XVT sed = Stream EDitor seq = SEQuence shar = SHell ARchive slrn = S-Lang rn ssh = Secure SHell ssl = Secure Sockets Layer stty = Set TTY su = Substitute User svn = SubVersioN tar = Tape ARchive tcsh = TENEX C shell telnet = TEminaL over Network termcap = terminal capability terminfo = terminal information tr = traslate troff = Typesetter new ROFF tsort = Topological SORT tty = TeleTypewriter twm = Tom's Window Manager tz = TimeZone udev = Userspace DEV ulimit = User's LIMIT umask = User's MASK uniq = UNIQue vi = VIsual = Very Inconvenient vim = Vi IMproved wall = write all wc = Word Count wine = WINE Is Not an Emulator xargs = eXtended ARGuments xdm = X Display Manager xlfd = X Logical Font Description xmms = X Multimedia System xrdb = X Resources DataBase xwd = X Window Dump yacc = yet another compiler compiler