Linux Sylfaenol Ardaloedd Rheoli ar Linux a Windows Systemau Gweithredu
Mae'r ysgrifennu yn ddefnyddiol ar gyfer y rhai sy'n dymuno i ddechrau arni gyda gorchmynion Linux. Here you will find the most common commands that are used in Linux.
Os hoffech chi i redeg Linux gorchmynion ar Windows yna gosod Cygwin. Cygwin is a Linux layer on top of Windows that allows you to use Linux commands in Windows.
Os byddwch yn gosod Cygwin ar Windows, yna mae'r llwybr rhagosodedig pan fyddwch yn dechrau, bydd y derfynell Cygwin yn:
C:\cygwin64\home\{username}
Creu Enghraifft ffeil notepad newydd
touch textfile.txt
Cyfeiriadur Newid
cd {directory path\name}
List directory content in long format ( -l ) including hidden files and directories ( -a )
ls -l -a
ls -al
Order files and directories by the time they were last modified
ls -t
List directory with pause and scrolling
ls -l | less
Dangos lleoliad presennol (print working directory)
pwd
Dyfyniad diwethaf 100 eiriau o ffeil
tail -100 {filename.extension}
Dyfyniad yn gyntaf 100 rhesi o ffeil
head -100 {filename.extension}
Copi ffeil
cp {source} {destination}
Symud ffeil
mv {source} {destination}
Gwnewch cyfeiriadur newydd
mkdir {new directory name}
Dileu'r ffeil
rm {filename}
Delete an empty directory
rmdir {directory to remove}
rm -d{directory to remove}
Delete directory and its contents
rm -r {directory to remove}
rm -R{directory to remove}
Trefnu yn cynnwys y ffeil
sort {filename to sort}
Dileu cofnodion dyblyg mewn ffeil
uniq {filename to remove duplicates}
Cywasgu ffeiliau
gzip {filename}
Cywasgu cyfeiriadur
gzip -r {directory name}
Cyfrifwch nifer y rhesi a geiriau mewn ffeil testun
wc {filename}
Search text within files for matching string pattern (case sensitive)
grep 'word' {filename}
Search text within files for matching string pattern (case insensitive)
grep -i 'word' {filename}
Search with a directory
grep -R Arctic /home/ccuser/workspace/geography
Cynnwys Arddangos o ffeil destun
cat
sed stream editor (similar to find and replace)
sed 's/snow/rain/' forests.txt
Newid ffeiliau a chyfeiriadur caniatadau
chmod {options} {permissions} {filename}
Rhestrwch gorchmynion diweddar a ddefnyddir
history
Yn awtomatig yn trefnu tasgau
cron
crontab
Hawliau'r ffeil Newid
chmod {permission number} {some file or directory}
chmod 777 /storage
Newid caniatâd ffeil recursive
chmod -R {permission number} {some file or directory}
