যদিও -cবিকল্পটির সাথে কাটাটি বেশিরভাগ ব্যবহারিক উদ্দেশ্যে কাজ করে, তবে আমি মনে করি যে ইতিহাসকে বিশৃঙ্খল করার জন্য এটি আরও ভাল সমাধান হবে। উদাহরণ স্বরূপ:
history | awk '{ $1=""; print }'
অথবা
history | awk '{ $1=""; print $0 }'
এই দুটি সমাধানই একই কাজ করে। ইতিহাসের আউটপুটটিকে বিশ্রীভাবে খাওয়ানো হচ্ছে। এর পরে ওওক প্রথম কলামটি ফাঁকা করে দেয় যা ইতিহাস কমান্ডের আউটপুটটিতে সংখ্যার সাথে মিল রাখে। এখানে খালি আরও সুবিধাজনক কারণ আউটপুট সংখ্যার অংশের অক্ষরের সংখ্যা নিয়ে নিজেকে চিন্তিত করতে হবে না।
print $0এর সমতুল্য print, যেহেতু ডিফল্টটি লাইনে উপস্থিত সমস্ত কিছু মুদ্রণ করে। টাইপিং print $0আরও সুস্পষ্ট, তবে কোনটি আপনি চয়ন করেন তা আপনার উপর নির্ভর করে। আচরণকে print $0কেবল printযখন awk সঙ্গে ব্যবহার আরো স্পষ্ট করে আপনি একটি ফাইল প্রিন্ট করতে awk ব্যবহার করে তা হল ( catawk পরিবর্তে টাইপ করতে দ্রুত হতে পারে, কিন্তু এই একটি বিন্দু ব্যাখ্যা জন্য)।
[প্রাক্তন] file 0 দিয়ে কোনও ফাইলের বিষয়বস্তু প্রদর্শনের জন্য awk ব্যবহার করা
$ awk '{print $0}' /tmp/hello-world.txt
Hello World!
[প্রাক্তন] সুস্পষ্ট without 0 ছাড়াই কোনও ফাইলের বিষয়বস্তু প্রদর্শনের জন্য অ্যাজকে ব্যবহার করা
$ awk '{print}' /tmp/hello-world.txt
Hello World!
[প্রাক্তন] ইতিহাস রেখাটি একাধিক রেখাকে বিস্তৃত করার সময় বিশ্রী ব্যবহার করে
$ history
11 clear
12 echo "In word processing and desktop publishing, a hard return or paragraph break indicates a new paragraph, to be distinguished from the soft return at the end of a line internal to a paragraph. This distinction allows word wrap to automatically re-flow text as it is edited, without losing paragraph breaks. The software may apply vertical whitespace or indenting at paragraph breaks, depending on the selected style."
$ history | awk ' $1=""; {print}'
clear
echo "In word processing and desktop publishing, a hard return or paragraph break indicates a new paragraph, to be distinguished from the soft return at the end of a line internal to a paragraph. This distinction allows word wrap to automatically re-flow text as it is edited, without losing paragraph breaks. The software may apply vertical whitespace or indenting at paragraph breaks, depending on the selected style."
cat ~/.bash_historyবরখাস্ত করা হয়?