王朝百科
分享
 
 
 

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,对于终端的命令只是知道简单的几个。但是不能原地踏步,所以整理一下与各位共享。

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
如何用java替换看不见的字符比如零宽空格​十六进制U+200B
 干货   2023-09-10
网页字号不能单数吗,网页字体大小为什么一般都是偶数
 干货   2023-09-06
java.lang.ArrayIndexOutOfBoundsException: 4096
 干货   2023-09-06
Noto Sans CJK SC字体下载地址
 干货   2023-08-30
window.navigator和navigator的区别是什么?
 干货   2023-08-23
js获取referer、useragent、浏览器语言
 干货   2023-08-23
oscache遇到404时会不会缓存?
 干货   2023-08-23
linux下用rm -rf *删除大量文件太慢怎么解决?
 干货   2023-08-08
刀郎新歌破世界纪录!
 娱乐   2023-08-01
js实现放大缩小页面
 干货   2023-07-31
生成式人工智能服务管理暂行办法
 百态   2023-07-31
英语学习:过去完成时The Past Perfect Tense举例说明
 干货   2023-07-31
Mysql常用sql命令语句整理
 干货   2023-07-30
科学家复活了46000年前的虫子
 探索   2023-07-29
英语学习:过去进行时The Past Continuous Tense举例说明
 干货   2023-07-28
meta name="applicable-device"告知页面适合哪种终端设备:PC端、移动端还是自适应
 干货   2023-07-28
只用css如何实现打字机特效?
 百态   2023-07-15
css怎么实现上下滚动
 干货   2023-06-28
canvas怎么画一个三角形?
 干货   2023-06-28
canvas怎么画一个椭圆形?
 干货   2023-06-28
canvas怎么画一个圆形?
 干货   2023-06-28
canvas怎么画一个正方形?
 干货   2023-06-28
中国河南省郑州市金水区蜘蛛爬虫ip大全
 干货   2023-06-22
javascript简易动态时间代码
 干货   2023-06-20
感谢员工的付出和激励的话怎么说?
 干货   2023-06-18
 
>>返回首页<<
 
 
 
静静地坐在废墟上,四周的荒凉一望无际,忽然觉得,凄凉也很美
© 2005- 王朝网络 版权所有