LinuxQuestions.org
Review your favorite Linux distribution.
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-17-2012, 12:11 AM   #1
johnyhasan
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, 12:24 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

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

HTH,

Evo2.
 
Old 07-17-2012, 04:16 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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:
http://tldp.org/LDP/Bash-Beginners-Guide/html/
 
Old 07-17-2012, 12:46 PM   #4
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 857

Rep: Reputation: 110Reputation: 110
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:

Code:
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:

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

OR

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:

Code:
gedit /home/yourusername/.bashrc

OR

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:

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

Code:
source ~/.bashrc

OR

. ~/.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.

Cheers!

--Dane
 
  


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
Create the file, write into that file but can't delete file in Linux pandunr Linux - Newbie 3 06-15-2011 08: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 06:33 AM
unable to create file & folder on fat32 file system while similiar other drives work sumeet inani Linux - Newbie 1 06-27-2009 11:46 AM
Create File Shell Syntax and pass data to the file FirstBorn Linux - General 22 07-31-2008 09:48 PM
Show file Content on File Select HTML stranger_6_7 Linux - General 4 09-24-2007 11:52 PM


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

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