ubuntu 遇到的一些问题和总结

来源:互联网 发布:网络答题系统 编辑:程序博客网 时间:2024/06/10 18:12


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

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