General :: Push/pop Current Directory?
Jan 11, 2011With bash is there a way to push and pop the current working directory? I tried writing bash;cd dir; ./dostuff;exit; but the current directory is now dir.
View 2 RepliesWith bash is there a way to push and pop the current working directory? I tried writing bash;cd dir; ./dostuff;exit; but the current directory is now dir.
View 2 RepliesI am in my current directory. I want to copy a directory somewhere else into this current directory. Lets say I want to take it from direc1/direc2 and the directory I want to take is called demo.
Code:
That is what it shows in the man pages, but when I do that, it says cp: no match
Well since tonight, after the upgrade to the latest current today, it was about a month I didn't upgrade, I cannot "git push" from my windows workstation (through msysgit shell)... I can pull, at least it tells me I'm up to date, but it keeps blocked on the 'push' command, returning only after a long timeout:
[Code]....
1. is there a way to prohibit a program from writing data on the hdd?
2. can i have different icons on each gnome workspace and how?
3. how to untar to current directory?
"tar -xvvf blablah.tar.gz" does not work
"tar -xvvf blabla.tar.gz -C ./" does not work
in both cases, the files go into some strange random locations.
4. how can i change the way colors are displayed for different content in the xfce terminal? I used to have red for archives, blue for dirs etc. in kde, but lost all that after changing to gnome.
How Can I Copy Everything in Current Directory to Subdirectory in linux console
View 6 Replies View RelatedIs it possible to find out the directory Thunar is currently displaying from the command line? I will only have one instance of Thunar open at one time.
View 3 Replies View RelatedAssumed y directory structure looks as follow:
Code:
--root
-- dir1
-- dir1-1
-- dir2
-- dir2-1
-- dir2-2
And under each sub dir there are some log files ended with .log. Now I want to list all these log files. How to to that?
How do you set current directory (full path) in an environment variable?
View 10 Replies View Relatedthis is gonna be changed to another thread
View 1 Replies View RelatedI have been playing around with the tar command and I know this is how to use it.
Code:
tar -cf [filename] [directory]
But what I want to make an archive from the current directory I thought just to not enter a directory but that doesn't work. I get an error about creating a empty archive so how to do I make it so how do I tell it to do the current directory?
Assumed y directory structure looks as follow:
Code:
--root
-- dir1
-- dir1-1
[code]....
And under each sub dir there are some log files ended with .log. Now I know how to list all these log files with:
Code:
find . -type f -name "*.log"
Assumed now there is a string called "Hello World" inside some of these files. How can I find out these files? I try followings but failed
Code:
grep "This is" | find . -mtime 0 -type f -name "*.log"
1. How can you find all first level subdirectories under the current directory?
2. How will you show the last 100 lines of the file "foo.log"?
3. How will you Stream the contents of a the log file "foo.log" as it gets written to?
4. How can you grep for a pattern on a gzip'ed file? e.g., find "foo" in bar.gz
5. Find all lines in the file "foo" which DON'T have the pattern "bar"
6. Your web server is running very slowly. If you can login to the server, what command will you run to find out cpu and memory use?
7. Extract the file foo which is a part of the tar'ed, gzip'ed file bar.tar.gz
8. You attach a usb disk to your linux desktop, but it does not show up. How can you get more information about the error?
9. What is the secure way to login to remote systems?
10. What is the difference between TELNET and SSH?
11. Given a file 'a' with the following permissions -rwxrwxrwx 1 rohit rohit 0 2011-01-24 13:30 a Change its permissions such that it is only readable and writable by its owner, not accessible by anybody else in the group and only executable by the world
12. Difference between using ' and " for quoting a string / command in a shell
13. In the attached text file (test.txt) replace all occurrences of 'red' with 'yellow' without using an editor (i.e. from the command line)
14. How would you suppress output written to stderr by a command
15. Meaning of the #! notation in scripts e.g. #!/bin/sh
16. What is the output of the attached shell script test.sh Scripting questions, all based on the attached file access.log. Use one of perl, python, ruby, or shell scripts to solve these questsions. If any answer is obtained using just the command line, please include those commands as well.
17. How many accesses were made between 10am and 11.30am on Jan 24, 2011?
18. How many unique IP addresses accessed this server?
19. For every IP address which accessed this server, output a report showing number of hits for every type of HTTP status. For e.g., IP 192.168.1.20 has 164 hits with status 404 and 1690 hits with status 200.
I have several directories of subtitles for some videos, but all the text for the subtitles in each file is in uppercase, and I would like to convert the files' content to lowercase, all in one go. I found on a website a bash command that would do each file separately:tr '[:upper:]' '[:lower:]' <input.txt> output.txt but of course involves specifying the input name and output name for each file.I have been trying to do it in a script that would work for all files in the current directory, without having to rename them each time, if that's possible. So far I've got the following, which doesn't work:
#!/bin/bash
for file in $@; do
tr '[:upper:]' '[:lower:]'
done
However, my web searches cannot locate a way of specifying "each file in current directory" in conjunction with the "tr" command, but also without having to rename the file once converted to lowercase. Is it possible, or would the tr command have to create a new file for each converted file?
I'm trying to compile a program from source. When I run make the following appears:./ config. status --recheck make: ./config.status: Command not found make: *** [config.status] Error 127.There is no file called config. status in the current directory. Why was it not created?
View 1 Replies View RelatedWhat command will provide you with the number of files in your current directory?
Choose one answer.
A. ls -c
B. ls | wc -w (this one)
C. ls -n | count
D. ls -wc (this one ?)
I have a jar file which can be executed by going to the directory and then running 'java -jar start.jar'. Start.jar is the Solr example server.I would like to create a boot script in init.d for this, but have little experience with this.Is there a way to specify the 'current' directory in a boot script?
View 1 Replies View RelatedI am total new to linux as I worked mostly on RTOS (symbian). My problem is, I need to find the file IOSTREAM.H and I am following commands below:
1) cd /
2) find . iostream.h ( finds the file / directory from the current path)
It shows No such File or Directory
Code:
$ echo 2 * 3 > 5 is a valid inequality. This will create a file in the current directory named '5' with the number '2' in it, the names of all the files in the current directory, followed by the number '3' and 'is a valid inequality.'
What I do not understand is why 'is a valid inequality' gets written to this file. I thought it would write '2', all the file names in the current directory, then '3' into the file called '5'. Why does the 'is a valid inequality.' get written to the file also?
I would like to keep track of not only what bash commands I used and when, but also where they were issued from, i.e. what was the current working directory when I issued "foobar" on a particular day and time. Can we ask bash history to keep track of working directories too? I have tried to get an idea of this reading the enormous "man bash", but I don't seem to have an answer yet either way.
View 11 Replies View RelatedI would like to modify Bash Prompt so it does not show the whole $PATH but just the current and parent directory. I am using Ubuntu.
View 3 Replies View RelatedI have the following problem:
CASE_FOLDER
----------->0_FOLDER
-------------------->ForceX ForceY ForceZ
[code]...
Is it possible to do it like Gmail does - when a new mail arrives, it shows it without having to click "Download"? Which email CLIENT would I use?
View 14 Replies View Related- I see that in git, I can't do git-push to a repository that wasn't created with git-init --bare. Why?
- But doing git-pull and git-checkout to the same repository is possible.?
I was wondering how the current working directory is maintained in linux. I assumed it would simply be an environment variable, but all attempts i've made to change directory by resetting variables shown by env have failed.Is this something that is maintained internally in the command prompt (bash in my case)?The background to this is I'm setting up a script to remotely run commands over ssh. Since separate commands will unfortunately require separate SSH connections, I need to maintain (save and reload) items such as environment variables and current working directory from one call of the script to the next.
View 4 Replies View RelatedI was wondering if it were possible to have a dual boot system (XP and Debian) where when you press, say F7, you will boot into windows or if your press F6 you will boot into Linux. I have a monitor that doesn't support the initial start-up graphics
View 2 Replies View RelatedI'm writing a script that performs backups from partitions on remote servers. I used to do this with ssh, but that seems to be somewhat slow, so I switched to netcat.I start a listener on the receiving server (which runs the script) like this:netcat -l -p 7000 | dd of=imagefile &and then I make the remote and start a dd piped to netcat. This works quite well started manually and the listener is waiting in the background. However, when I have cron run the same script to automate it, the netcat listener is not started, probably because the "&" thing does not work (or there is something with the piping that behaves differently then)
View 7 Replies View RelatedI have a simple shell script name "run.sh".
Code:
export PYTHONHOME="lib/"
python dispatch.py
[code]....
when we navigate into directories withing directories the terminal displays the entire path right from the root. Now how to make it just show the current directory I am working in? For examplevineeth@vineeth-laptop:~/Desktop/linux_programming/python_programming/project_duplicate_zip_files$ as you can see that I am in the current project_duplicate_zip_files directory but it displays right from the root. how to just make it something like below:vineeth@vineeth-laptop:/project_duplicate_zip_files$
View 2 Replies View RelatedSo for example, I go to PLACES -> DOWNLOADS and somehow open up a terminal for that rather than opening up a terminal to type "cd ~/Downloads" I know its simple to do that but when your dealing with some crazy directory like:
/media/2TB-DATA/BackUps/Regular/Downloads/Pictures/Family/Me/HiDef/ or something, and ur already browsing through it using the file browser, it would be nice to be able to open up a terminal for that directory.
I recently got involved in a project which uses brain-dead GNU indentation style.
So I need to set vim to 2-char tabs when working on that project, but otherwise I want to keep my original configuration.
Is there a way to have options in .vimrc that depend on the current working directory, so I don't have to switch back and forth manually?