apple mac os x

I am a new Unix shell programer. How can I extract the directory name from a full path (say /nas01/data/backups/file.tar.gz)? How do I get directory name from its path on a Linux or Unix-like system?

{ 1 comment }

I often type the wrong command as follows under Linux bash shell:
rsync -av dir1 user@server1.cyberciti.biz:/path/to/dir1
OR
cp -av file1*.txt file2*.txt /path/to/dest

I need to correct those command as follows:

rsync -av dir5 user@server1.cyberciti.biz:/path/to/dir1
cp -av delta1*.txt delta2*.txt /path/to/dest

How do I replace dir1 with dir5 or file with delta and repeat the last command under bash shell?

{ 5 comments }

How do I mirror files from remote ftp server using lftp command? How do put the entier directory from a local disk to a remote ftp server (reverse mirror) using lftp command under Linux and Unix like operating systems?

{ 8 comments }

How do I remove a symlink under Apple Mac OS X using bash command line option?

{ 1 comment }

I‘m using ps command to read a snapshot of the current processes under Unix / Linux operating systems. However, ps -e or ps aux only displays command / processes names. I need to see complete information about the process including all parameters passed to it. How do I see it under Unix / Linux using ps command?

{ 0 comments }

cat command

I am a new Linux and Unix system user. How do I use cat command on Linux or Unix-like operating systems? Can you provide basic examples and syntax usage for cat command?

{ 7 comments }

I‘m using vim as a text editor and editing a large code file written in python. How do I jump to end of file using vim text editor under Apple Mac OS X Unix operating systems?

{ 5 comments }