• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

without

History Without Line Numbers

September 8, 2022

Here’s how to display history without the line numbers.

history -w /dev/stdout

history -w /dev/stdout

Result

cd /etc/httpd/conf
view httpd.conf 
vim wiki.conf 
vim ssl.conf

cd /etc/httpd/conf view httpd.conf vim wiki.conf vim ssl.conf

Filed Under: Linux Tagged With: history, lines, list, without

Copy Directory Structure

August 25, 2022

Here’s how to copy a directory structure from one directory to another without the files.

Copy directory structure of DIR1 to DIR2.

find /DIR1 -type d > /tmp/dirs.txt
sed -i 's/DIR1/DIR2/' /tmp/dirs.txt 
xargs mkdir -p < /tmp/dirs.txt
chown -R USER:GROUP /DIR2

find /DIR1 -type d > /tmp/dirs.txt sed -i 's/DIR1/DIR2/' /tmp/dirs.txt xargs mkdir -p < /tmp/dirs.txt chown -R USER:GROUP /DIR2

Filed Under: Linux Tagged With: copy, directory, files, structure, without

View contents of tar file

September 8, 2019

Here’s how to view the contents of a tar file without extracting the files.

tar -tvf file.tar

tar -tvf file.tar

Filed Under: Linux Tagged With: extracting, linux, tar, view, without

Run Docker Without Sudo

February 10, 2019

Run Docker without sudo. Add user to docker group. Login as docker using newgrp.

sudo gpasswd -a $user docker
newgrp docker

sudo gpasswd -a $user docker newgrp docker

You can now run the following commands without sudo.

docker ps
docker images

docker ps docker images

Every time you open a new terminal , just run.

newgrp docker

newgrp docker

Filed Under: Linux Tagged With: docker, sudo, without

  • Home
  • About
  • Archives

Copyright © 2023