1
vote
1answer
149 views

How to create a file with symbols in its name

How can I create a file starting from $SHELL, using quotes like " ",' ', \? I tried, but it's not working.
1
vote
1answer
204 views

Delete all files that don't start with a certain string in a folder

How can I delete all files that don't start with "2012" in a particular folder? This is on OS X Lion.
2
votes
1answer
300 views

What is a socket link?

After noticing an interesting environment variable Apple_PubSub_Socket_Render. I notice that it was referring directly to this "Render" file. After doing a listing of "Render": ls -lh Render I ...
2
votes
1answer
1k views

copy same file into multiple directories - permission denied error

Please help me in solving the below issue: I want copy a file say info.txt into multiples directories and their sub-directories . I used this command: go to parent directory. find . -type d -exec ...
1
vote
1answer
2k views

how do I compress all files within a folder on Unix?

I've been unable to compress the contents of a folder on Unix, note that I don't want to compress the directory itself but the contents inside. so far.. to compresss the files I use: compress ...
0
votes
3answers
76 views

Is there any file I can read in unix which contains the time

Is there any file in unix based system which I can read, to get the same value that time() in php would return?
1
vote
1answer
133 views

Setting the last file status change time

stat will report the last access time, last data modification time, and last file status change time. utimes will allow one to set the last access time and last data modification time. Is there a ...
3
votes
1answer
325 views

Attributes of a file

I am trying to determine what all of the attributes are of a regular file (as opposed to a symbolic link, etc.) on Mac OS X with Mac OS Extended (Journaled) (HFS+). Here is my current list: ...
0
votes
1answer
423 views

Perform a math operation on all numbers in a file

I have a list of pixel values in a file, and need each to be half its current value. The pattern for the value is always 123px where 123 varies drastically. How can I half each pixel value? I'm ...
2
votes
1answer
2k views

How can I (on Mac/Unix/Linux/scripting) recursively copy a directory into another and replace only the files that have not changed?

Background and issue I moved to Mac OS X recently and bumped into the "feature" of Mac where copying files from an external drive resets the file modification/update date/timestamp to the current ...
0
votes
3answers
175 views

Unix/Mac [bash/c api]: detect if a given path points to a file on a removable device

Is there a *nix command or C api that will tell the type of the storage device given the path to the file (resolving the mounts, symlinks, etc)? I need to find out whether the file lives on a ...
2
votes
2answers
3k views

Find and remove all empty files

How can I search all empty files of non-root system and delete them?
1
vote
4answers
1k views

Tool to monitor file read/write in unix

Is there any tool/command available in unix to monitor read/writes in a particular file. I also want to collect how much data is being read each time the file is accessed.
1
vote
1answer
337 views

Tail the filename, not the file

In UNIX (OS X BSD to be precise), I have a "tail -f" command on a log file. From time to time I want to delete this log file so I can more easily review it in my text editor. I delete the file, and ...
3
votes
2answers
5k views

How do I close a file that I created using cat > command?

I learning how to use git on a Mac and I'm trying to add a file in one of my branches by using the "cat > " command. The problem I'm having is that I want to end editing the file in the terminal but I ...
1
vote
2answers
147 views

How to download files from command line?

For example, see this page Advanced Linux Programming. I want to download all the pdf files linked from this page. Is there a simple commandline way of doing it? Something on the lines of download ...
1
vote
3answers
9k views

How to create a cron job to upload files to an FTP server

I would like to create a cron job that uploads files from a directory on my computer to my FTP server. I would like it to do it daily at midnight. I know pretty much nothing about cron, so I ...