Important Commands working with huge directory in gcloud

Important Commands working with huge directory in gcloud instance where I am using BITNAMI CLOUD LAUNCHER

Making a public key in your UBUNTU system

ssh-keygen
cat dff-ssh-key
cat dff-ssh-key.pub

Copy and paste this key to you gcloud compute-engine->meta-data>ssh-keys.

Making a tunnel with your localhost and gcloud database.

ssh -N -L 8888:127.0.0.1:80 bitnami@IP

Opening SFTP in your file manager

ssh-add /home/shakalya/dff-key

In filemanager

sftp://bitnami@IP/home/bitnami

In terminal

ssh -i /home/shakalya/dff-key bitnami@IP

Moving Files form SSH from another server to current.

I logged into the gcloud SSH via terminal and moving all image file from another SERVER which has user USER2 and IP as IP2

scp -rp USER2@IP2:public_html/image target_path

Putting all directory permission to 755 and  files permission to 644

find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;

Important commands working with large number of file inside a folder.

List all files starting from aaa*

ls aaa* | wc -l

Count all files and folders inside an directory.

ls -1 | wc -l

List first 30 files in a directory
ls -U | head -30

listing all directory only inside a directory
ls -d /home/bitnami/htdocs/image/data/*/

Moving all files from current directory to another
for file in $(ls -p | grep -v / ); do mv $file /var/www/html/image/; done

Moving all files starting from level* from current directory.
for file in $(ls -p level* | grep -v / ); do mv $file /var/www/html/image/; done