Questions tagged [unix-shell]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
14 votes
8 answers
8k views

Deleting a UNIX directory with a hyphen in the name

Through a boneheaded maneuver on my part, I accidentally created a directory called (for instance) -A, and ended up filling it with files. I want to delete said directory. I've tried: rmdir -- -A ...
Kate Bertelsen's user avatar
0 votes
4 answers
1k views

direct file transfer via ftp to ftp

Hi i want to transfer few file (which is very big in size ) from A server to B server via ftp. I have credentials of Server A's ftp and Server B's ftp - server B is my own server running unix. so ...
Hunt's user avatar
  • 1
43 votes
5 answers
21k views

Faking the date for a specific shell session

I'm certainly trying to achieve something weird here, but I want to fake the date locally for a shell session on GNU/Linux. I need to black-box test how a program behaves at different dates, and ...
nicoulaj's user avatar
  • 1,205
31 votes
2 answers
47k views

When to use single quotes, double quotes, or no quotes in grep?

While trying to search for a simple pattern "hello" in a file, all the following forms of grep work: grep hello file1 grep 'hello' file1 grep "hello" file1 Is there a specific case where one of the ...
user avatar
16 votes
7 answers
13k views

In *nix, how to determine which filesystem a particular file is on?

In a generic, modern unix environment (say, GNU/Linux, GNU/Solaris, or Mac OS X), is there a good way to determine which mountpoint and filesystem-type a particular absolute file path is on? I ...
smokris's user avatar
  • 715
3 votes
5 answers
5k views

Search and delete lines matching a pattern along with comments in previous line if any

I have a requirement to write a shell script in csh to search and delete lines matching a pattern along with comments in previous line if any. For example if my file has the following lines Shell ...
user avatar
3 votes
1 answer
146 views

Editing the PATH in PASE

I am doing a some PHP development on an IBMi running ZendServer6. I have to call PHP by its full path of /usr/local/zendsvr6/bin/php-cli. Is there a dotfile I can edit in my home directory or some ...
Justin Dearing's user avatar
3 votes
3 answers
2k views

sudo and sudo -i access features

What are privilege differences between sudo and sudo -i? With sudo it's $sudo echo "search foo.bar.baz" >> /etc/resolv.conf bash: /etc/resolv.conf: Permission denied ...and with sudo -...
Alex's user avatar
  • 2,407
0 votes
1 answer
3k views

How to run a program inside chroot with stdin/stdout available to caller?

Is there a way to run a program in a chroot while still having access to stdin/stdout? My first attempt was a shell script: /usr/local/bin/real-app: -------- #!/bin/bash chroot /var/lib/app-root /...
Mark Renouf's user avatar
  • 1,373
0 votes
1 answer
486 views

Wow, there is no way this is wrong. What is wrong? [closed]

I am going to put this out there first, this is my shell script homework. However, I am finished with my work. It is just not running properly for some reason. I already asked 2 game developer ...
Strawberry's user avatar
  • 1,152