ubuntu 遇到的一些问题和总结


first is something about date command

 date --help
 you could see a lot of things
 usually , we use date
 cal command is for the calender

 bc command is for a calc .



cat -n filename : 

you could find the line the cuorse is in.


the previlige of user group other all 
one of the way is
chmod a + x filename : give x to all user 
chmod u -x filename : expire x from user 

if you want to change your super user's passwd , 

on the condition that dont know su passwd, you can simply edit the grub menu, find the ubuntu item , at the end line of "kernel", append "single" mode, and then , Ctrl +x or F10 go into the terminal

type "passwd", you can change the passwd of super user


http://askubuntu.com/questions/129322/how-to-install-a-driver-for-an-nvidia-card-not-detected-by-additional-drivers

关于这个问题,个人感觉是ubuntu的问题,有的电脑有附加驱动,有的没有,版本号的问题吧。还是直接装kubuntu来的快一点....

change the promote of ternimal:
One of the first things I do after having a fresh Installation, is to change the command prompt to something I like. I know most of you linuxers would want to make the prompt look cooler than the usual "name-hostname: / $". But command prompt is not all about coolness, it serves a lot more useful purposes than it appears. In this howto, I will show you how to change your command prompt by editing PS1 environment variable and make it useful and cool at the same time .


In order to change the prompt you should know that the PS1 environment variable is responsible for it. Setting its value will change the command prompt. In order to know what the current value of this environment variable is, run the following command


    [shredder12]$ echo $PS1


This will show you something like


    [\u@\h \W]\$


and if its a debian or ubuntu system then the output will look like


    \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}shredder12:\w\$


I know it looks scary but once understand the basics you can easily play around with this.
Editing the PS1 environment variable


Let us start with the first example.


    [\u@\h \W]\$


Here '\u' means the username of the current user, \h stands for the hostname upto the first '.' and \W stands for the base name of the current working directlory with your $HOME(the user home directory) directory being specified as ~(tilda). '@' and '$' are ascii characters. We will learn more terminology soon, but for now lets stick to these three.


So, now if the username is "shredder12", hostname is "my.computer" and the current directory is /home/shredder12/Documents then the bash prompt will look something like.


    [shredder12@my ~/Documents]$


As you can see its really simple, using similar attributes we can make more changes in our prompt. Say, you want to add time and date too in the prompt, we will use /t and /d attributes to do that. Now, the PS1 environment variable will look like


    [\u@\t \d]$


and your prompt will be like this


    [shredder12@11:47:19 Mon Jan 18]$


Saving the new PS1 variable in a bash script file


Now, you can easily change the PS1 variable to suit your needs but you will have to make the changes in the bash scripts to make them permanent.


If you are on a multiuser system then I would suggest you to add this line at the end of your $HOME/.bashrc file


    export PS1="[\u@\t \W]$"


and then either run


    source $HOME/.bashrc


or exit the terminal and open it again.




sudo lsb_release -a
查看發行版本
sudo cp -r

 這樣可以把目錄同樣的複製到自己制定的場合

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值