分享
 
 
 

ubuntu终端命令

王朝百科·作者佚名  2010-08-31
窄屏简体版  字體: |||超大  

通常的ubuntu有以下几个版本,第一步是找到终端的位置:

Starting a TerminalIn Gnome (Ubuntu)The terminal can be found atApplications menu->Accessories->Terminal.In Xfce (Xubuntu)The terminal can be found atApplications menu->System->Terminal.In KDE (Kubuntu)The terminal can be found atKMenu->System->Terminal Program (Konsole).

第二步,当然是相应的命令了:

Commandssudo: Executing Commands with Elevated Privileges 执行命令特权 sudo是允许系统管理员让普通用户执行一些或者全部的root命令的一个工具,如halt,reboot,su等等。这样不仅减少了root用户的登陆 和管理时间,同样也提高了安全性。Sudo不是对shell的一个代替,它是面向每个命令的。(ps:王朝里已经有sudo的相关搜索,感兴趣的可以去看看。)

Most of the following commands will need to be prefaced with thesudocommand if you will be working with directories or files not owned byyour account. This is a special command which temporarily gives youaccess to change computer settings. The terminal will ask you for yourpassword. Please see RootSudo for information on using sudo.

File & Directory Commands 针对文件和目录的命令pwd(显示当前位置): Thepwdcommand will allow you to know in which directory you're located (pwdstands for "print working directory"). Example:"pwd"in the Desktop directory will show "~/Desktop". Note that the GnomeTerminal also displays this information in the title bar of its window.

ls(列出详细资料): Thelscommand will show you the files in your current directory. Used withcertain options, you can see sizes of files, when files were made, andpermissions of files. Example:"ls ~"will show you the files that are in your home directory.

cd(进入目录): Thecdcommand will allow you to change directories. When you open a terminalyou will be in your home directory. To move around the file system youwill usecd. Examples:

To navigate into the root directory, use"cd /"

To navigate to your home directory, use"cd"or"cd ~"

To navigate up one directory level, use"cd .."

To navigate to the previous directory (or back), use"cd -"

Tonavigate through multiple levels of directory at once, specify the fulldirectory path that you want to go to. For example, use,"cd /var/www"to go directly to the /www subdirectory of /var/. As another example,"cd ~/Desktop"will move you to the Desktop subdirectory inside your home directory.

cp(复制): Thecpcommand will make a copy of a file for you. Example:"cp file foo"will make a exact copy of "file" and name it "foo", but the file "file"will still be there. If you are copying a directory, you must use"cp -r directory foo"(copy recursively).

mv(移动): Themvcommand will move a file to a different location or will rename a file. Examples are as follows:"mv file foo"will rename the file "file" to "foo"."mv foo ~/Desktop"will move the file "foo" to your Desktop directory but will not rename it. You must specify a new file name to rename a file.

To save on typing, you can substitute '~' in place of the home directory. Note that if you are usingmvwithsudoyou can use the ~ shortcut, because the terminal expands the ~ to yourhome directory. However, when you open a root shell withsudo -iorsudo -s, ~ will refer to the root account's home directory, not your own.

rm(删除文件): Use this command to remove or delete a file in your directory.

rmdir(删除目录): Thermdircommand will delete anemptydirectory. To delete a directory and all of its contents recursively, userm -rinstead.

mkdir(创建目录): Themkdircommand will allow you to create directories. Example:"mkdir music"will create a directory called "music".

man(帮助): Themancommand is used to show you the manual of other commands. Try"man man"to get the man page formanitself. See the "Man& Getting Help" section down the page for more information.System Information Commands 系统信息命令df(显示文件系统中还有多少剩余空间): Thedfcommand displays filesystem disk space usage for all mounted partitions. "df -h" is probably the most useful - it uses megabytes (M) and gigabytes (G) instead of blocks to report. (-hmeans "human-readable")

du(显示目录中文件或目录的具体大小): Theducommand displays the disk usage for a directory. It can either displaythe space used for all subdirectories or the total for the directoryyou run it on. Example: (以floppy文件夹为例)

user@users-desktop:~$ du /media/floppy

1032 /media/floppy/files

1036 /media/floppy/

user@users-desktop:~$ du -sh /media/floppy

1.1M /media/floppy/(-smeans "Summary" and-hmeans "Human Readable")

free(显示已用和剩余的空间大小): Thefreecommand displays the amount of free and used memory in the system."free -m"will give the information using megabytes, which is probably most useful for current computers.

uname -a(显示所有的系统信息): Theunamecommand with the-aoption prints all system information, including machine name, kernelname & version, and a few other details. Most useful for checkingwhich kernel you're using.

lsb_release -a(显示当前用的版本): Thelsb_releasecommand with the-aoption prints version information for the Linux release you're running, for example:

user@computer:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Ubuntu

Description: Ubuntu 6.06 LTS

Release: 6.06

Codename: dapperifconfig(报告系统的网络状态) reports on your system's network interfaces.

ps:小弟我也是刚刚接触ubuntu,对于终端的命令只是知道简单的几个。但是不能原地踏步,所以整理一下与各位共享。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有