Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 07-17-2012, 01:11 AM   #1
LQ Newbie
Registered: Jun 2012
Posts: 9

Rep: Reputation: Disabled
Post create file and show file

i create a file
touch jas.txt
how can i see the file where file is stayed jas.txt?
plz help me.
Old 07-17-2012, 01:24 AM   #2
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,720

Rep: Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704Reputation: 1704

welcome to lq. You "see" the file using the ls command (short for list).
I suggest that you do a little background reading. The rute book might be a good start.
Have a look at chapter 4.


Old 07-17-2012, 05:16 AM   #3
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
by default, anything you do to create a file will put it in the current directory.

For this and your other question, I recommend this:
Old 07-17-2012, 01:46 PM   #4
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 881

Rep: Reputation: 130Reputation: 130
If you don't know where you are, you can always type, "pwd" to see the "Current Working Directory"--where you are right now.

Depending on how your computer is set up, you can have it so that your command prompt always tells you where you are. I find this useful, especially coming from a DOS or Windows command-line background.

If your prompt isn't showing you this, or if it's just telling you the last part of your directory tree, you can change it, as follows.

First, find out what your command prompt variable, PS1 is right now:

echo $PS1
Remember that all command text is case-sensitive.

First, look for "\w" or "\W" in what that command gives you. If you see "\W" (capital W), it's only showing you the last part of your directory tree. If you see "\w" (lowercase w), it's showing you the whole thing, and you don't need to change it. (If your prompt ever says you're in "~", that means you're in your home directory: "/home/yourusername".)

Now, backup your bash configuration file, /home/yourusername/.bashrc:

cp -vf /home/yourusername/.bashrc /home/yourusername/.bashrc.backup


cp -vf ~/.bashrc ~/.bashrc.backup
(These commands do the same thing.)

Now, if you need to make a change, highlight and copy the output of your "echo $PS1" command. Then, use a text editor--probably gedit or kedit--to edit the file, /home/yourusername/.bashrc--like this:

gedit /home/yourusername/.bashrc


kedit /home/yourusername/.bashrc
In that file, look for any line that says, "PS1='blahblahblah'". If that line exists, change the capital W to a lowercase one, save and exit. If there is no '\W'--capital or lowercase (which is rare on Linux distributions), then you can add it somewhere before "\$". If you put it in the wrong place, you can always edit the file and try again. If you ever really screw it up, you can do this to restore the backup file:

cp -vf ~/.bashrc.backup ~/.bashrc
Finally, to make your changes take effect, do this:

source ~/.bashrc


. ~/.bashrc
("." is a shortcut for the "source" command.)

You should now have a command prompt that always tells you where you are! If, by some chance, when you reboot or log out/in, your command prompt doesn't stay this way, it's because your version of Linux doesn't automatically read ~/.bashrc like it should. Let me know if this is the case, and I'll tell you how to fix it.




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
Create the file, write into that file but can't delete file in Linux pandunr Linux - Newbie 3 06-15-2011 09:45 AM
Create a script that asks the user for a file and then appends the date to the file larry5757 Linux - Newbie 2 12-04-2009 07:33 AM
unable to create file & folder on fat32 file system while similiar other drives work sumeet inani Linux - Newbie 1 06-27-2009 12:46 PM
Create File Shell Syntax and pass data to the file FirstBorn Linux - General 22 07-31-2008 10:48 PM
Show file Content on File Select HTML stranger_6_7 Linux - General 4 09-25-2007 12:52 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:07 PM.

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