Showing posts with label Linux Commands. Show all posts
Showing posts with label Linux Commands. Show all posts

Tuesday, May 29, 2018

Linux-Shell Script to Move to specific folder using "cd" command




Shell scripts are run inside a subshell, and each subshell has its own concept of what the current directory is. The cd succeeds, but as soon as the subshell exits, you're back in the interactive shell and nothing ever changed there.

To Resolve that we use bash command. 




#!/bin/sh
#!/bin/bash

cd "/opt/azw/webapp/src/";
bash



Thursday, August 11, 2016

Linux Commands


1. To remove files in current directory

rm -rf ./*


2.To change the file permissions

Why is Magento 1.4 including javascript files by filesystem path?
  
 chmod -R 777 var/ media/
-R --recusively
777 --- Full permissions to all users
var/media --- directory path


3. Add svn repositry in server

svn co  
 svn co https://acd.svn.beanstalkapp.com/ekr-tbp/trunk test2/


4. To start the apache server

service httpd start
service httpd stop

5. To see the error log

tail
tail -f  
cat  

6.To Rename the folde name
mv old-file-name  new-file-name

7. Zip the files on current directory
tar -cvf aws6-9-16.tar
tar -czf aws6-9-16.tar.gz . --exclude=./*.gz

mv testfile testfile2

8. To set number in vim editor
:set nu

9. To remove all content of  a file using vim editor
:1,$d
dgg
10. Download a file using curl
curl -OL http://pear.php.net/go-pear.phar

11. To unzip specific file on current directory
unzip agf-stage.zip -d .
. ---current directory
agf-stage.zip ---file name