LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2011, 11:55 PM   #1
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Rep: Reputation: Disabled
Shell Script Does Not Exist


c@c-laptop:~$ locate /.bashrc
/etc/skel/.bashrc
/home/c/.bashrc
/root/.bashrc

I need to edit /home/c/.bashrc

However when I go to place> Home folders to go to /home/c , the file is not there.

What should I do to make the file appear so that I can edit it?

It is obviously a system file.
 
Old 07-12-2011, 12:03 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Files whose name starts with a dot are hidden! From a terminal you can do
Code:
ls -a
to show them. From a file manager there should be an option to show hidden files, as well. In any case from a terminal open your favorite text editor and you will find it, e.g. using vi
Code:
vi /home/c/.bashrc
Quote:
Originally Posted by hitmen View Post
It is obviously a system file.
Not really. It is the user's configuration file for the bash shell. It is copied from /etc/skel/.bashrc whenever a user is created, but then it is a file owned by the user, that can be customized to suit the user's need.

Last edited by colucix; 07-12-2011 at 12:06 AM.
 
Old 07-12-2011, 12:31 AM   #3
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
Hi

is there a graphical interface for this?

I cant seem to edit vi /home/c/.bashrc from command prompt.
 
Old 07-12-2011, 12:57 AM   #4
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
I dunno why nano works but vi does not work properly.
 
Old 07-12-2011, 12:58 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
start with cd'ing into the dir, then do
Code:
ls -al .bashrc
and post result
 
Old 07-12-2011, 01:01 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
What does "vi does not work properly" mean? Any error message? If you need a GUI editor, try gedit (if running GNOME) or kwrite (if running KDE). They should be installed by default.
 
Old 07-12-2011, 01:14 AM   #7
hitmen
Member
 
Registered: Jun 2011
Distribution: Kubuntu 10.04
Posts: 158

Original Poster
Rep: Reputation: Disabled
-rw-r--r-- 1 c c 3007 2011-07-12 21:56 .bashrc


Well I cant type words using the vi editor.
Is there any difference between vi and nano?

This is because this is the first time I am using vi.
Is it different from any text editor?
 
Old 07-12-2011, 01:20 AM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Quote:
Originally Posted by hitmen View Post
-rw-r--r-- 1 c c 3007 2011-07-12 21:56 .bashrc


Well I cant type words using the vi editor.
Is there any difference between vi and nano?

This is because this is the first time I am using vi.
Is it different from any text editor?
Yes. In vi you have to switch between COMMAND mode and INSERT mode. Whenever you type a i (insert), a (append), o (append new line) command you automatically switch into INSERT mode, then press Esc to exit and return to COMMAND mode. Look at vi documentation to learn about its commands. Indeed it requires a bit of practice and patience.

Last edited by colucix; 07-12-2011 at 01:21 AM.
 
Old 07-12-2011, 01:25 AM   #9
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,493

Rep: Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867Reputation: 2867
Yes it is different and has 2 different modes. When you start it you are in command mode and as the name suggests it allows you to send commands
to the editor, some of which take you to the second mode which is insert mode and this allows you to enter text into the file.

Just type - vi tutorial - into google and you will find a plethora of information. Should you wish to continue with it I would also suggest installing vim
which is vi improved and is a little more user friendly.
 
Old 07-13-2011, 02:26 AM   #10
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
or just open a terminal and type vimtutor its a pretty good tutorial on vi.
 
Old 07-13-2011, 02:36 AM   #11
nooneknowme
Member
 
Registered: Feb 2008
Location: Bangalore, India
Posts: 69

Rep: Reputation: 5
If you want to see the files via the GUI .. There is an option in Nautilus-> View -> Show Hidden Files
 
Old 07-13-2011, 02:42 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by nooneknowme View Post
If you want to see the files via the GUI .. There is an option in Nautilus-> View -> Show Hidden Files
Shortcut on Thunar file manager (probably Nautilus too): Ctrl+H
 
Old 07-13-2011, 02:46 AM   #13
nooneknowme
Member
 
Registered: Feb 2008
Location: Bangalore, India
Posts: 69

Rep: Reputation: 5
Quote:
Originally Posted by catkin View Post
Shortcut on Thunar file manager (probably Nautilus too): Ctrl+H
yes Ctrl+H is the shortcut in Nautilus too
 
1 members found this post helpful.
Old 07-13-2011, 03:12 AM   #14
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,072

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
First, ~/.bashrc has not to be in there, just create it yourself.

Second, any editor will do, just pick one that you like, it doesn't matter if it's GUI or text based as long as it's a plain text editor and not a word processor.
 
Old 07-13-2011, 07:29 PM   #15
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Actually, according to post#7, it's there ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
to find if a file exist using shell script nanxy Programming 8 09-16-2013 10:30 PM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
Request : set passwords for many users [user accounts exist] using a shell script bv_uma Linux - Software 3 08-19-2006 09:01 AM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM


All times are GMT -5. The time now is 01:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration